├── .gitignore ├── types ├── es2015-promise.d.ts ├── es2018-promise.d.ts ├── es2019-symbol.d.ts ├── es2020-global-this.d.ts ├── es2020-string.d.ts ├── es2019-object.d.ts ├── es2020-promise.d.ts ├── es2020-symbol-wellknown.d.ts ├── es2018-async-iterable.d.ts ├── es2019-array.d.ts ├── es2017-string.d.ts ├── es2016-array-include.d.ts ├── es2015-collection.d.ts ├── es2017-object.d.ts ├── es2019-string.d.ts ├── es2015-symbol.d.ts ├── index.d.ts ├── es2017-typed-arrays.d.ts ├── es2015-reflect.d.ts ├── es2015-symbol-wellknown.d.ts ├── es2015-iterable.d.ts └── es2015-core.d.ts ├── .vscode └── settings.json ├── .gitattributes ├── lib ├── es2015-promise.js ├── es2018-promise.js ├── es2019-object.js ├── es2019-symbol.js ├── es2020-global-this.js ├── es2020-promise.js ├── es2020-string.js ├── es2018-async-iterable.js ├── es2020-symbol-wellknown.js ├── es2019-array.js ├── es2017-string.js ├── es2016-array-include.js ├── es2015-collection.js ├── es2017-object.js ├── es2019-string.js ├── es2015-symbol.js ├── index.js ├── es2017-typed-arrays.js ├── es2015-reflect.js ├── es2015-symbol-wellknown.js ├── es2015-iterable.js └── es2015-core.js ├── .npmignore ├── src ├── index.ts ├── es2020-global-this.ts ├── es2019-symbol.ts ├── es2020-string.ts ├── es2018-promise.ts ├── es2019-string.ts ├── es2019-object.ts ├── es2020-symbol-wellknown.ts ├── es2018-async-iterable.ts ├── es2020-promise.ts ├── es2017-typed-arrays.ts ├── es2015-reflect.ts ├── es2017-string.ts ├── es2017-object.ts ├── es2015-symbol.ts ├── es2015-collection.ts ├── es2016-array-include.ts ├── es2019-array.ts ├── es2015-promise.ts └── es2015-symbol-wellknown.ts ├── LICENSE ├── .github └── workflows │ └── nodejs.yml ├── rollup.config.js ├── tsconfig.json ├── official-lib-declarations ├── lib.d.ts ├── lib.es2019.symbol.d.ts ├── lib.es2020.string.d.ts ├── lib.es2017.intl.d.ts ├── lib.es2018.regexp.d.ts ├── lib.es2019.string.d.ts ├── lib.es2018.promise.d.ts ├── lib.es2019.object.d.ts ├── lib.es2020.symbol.wellknown.d.ts ├── lib.es2017.typedarrays.d.ts ├── lib.es2015.symbol.d.ts ├── lib.es2018.asynciterable.d.ts ├── lib.es2015.reflect.d.ts ├── lib.es2020.promise.d.ts ├── lib.es2015.proxy.d.ts ├── lib.es2018.intl.d.ts ├── lib.es2017.string.d.ts ├── lib.es2017.object.d.ts ├── lib.es2015.generator.d.ts ├── lib.es2018.asyncgenerator.d.ts ├── lib.es2015.collection.d.ts ├── lib.es2019.array.d.ts ├── lib.es2016.array.include.d.ts ├── CHANGELOG.MD ├── lib.es2017.sharedmemory.d.ts ├── lib.es2015.promise.d.ts ├── lib.es2015.symbol.wellknown.d.ts ├── lib.dom.iterable.d.ts └── lib.es2015.iterable.d.ts ├── package.json ├── update-libs.ps1 └── README.MD /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | -------------------------------------------------------------------------------- /types/es2015-promise.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/promise'; 2 | -------------------------------------------------------------------------------- /types/es2018-promise.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/promise/finally'; 2 | -------------------------------------------------------------------------------- /types/es2019-symbol.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/symbol/description'; 2 | -------------------------------------------------------------------------------- /types/es2020-global-this.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/global-this'; 2 | -------------------------------------------------------------------------------- /types/es2020-string.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/string/match-all'; 2 | -------------------------------------------------------------------------------- /types/es2019-object.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/object/from-entries'; 2 | -------------------------------------------------------------------------------- /types/es2020-promise.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/promise/all-settled'; 2 | -------------------------------------------------------------------------------- /types/es2020-symbol-wellknown.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/string/match-all'; 2 | -------------------------------------------------------------------------------- /types/es2018-async-iterable.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/symbol/async-iterator'; 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules\\typescript\\lib" 3 | } -------------------------------------------------------------------------------- /types/es2019-array.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/array/flat-map'; 2 | import 'core-js/es/array/flat'; 3 | -------------------------------------------------------------------------------- /types/es2017-string.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/string/pad-start'; 2 | import 'core-js/es/string/pad-end'; 3 | -------------------------------------------------------------------------------- /types/es2016-array-include.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/array/includes'; 2 | import 'core-js/es/typed-array/includes'; 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | lib/**/*.js linguist-generated=true 2 | dist/**/*.js linguist-generated=true 3 | rollup*.js linguist-language=TypeScript 4 | -------------------------------------------------------------------------------- /lib/es2015-promise.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/promise"); 4 | -------------------------------------------------------------------------------- /lib/es2018-promise.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/promise/finally"); 4 | -------------------------------------------------------------------------------- /lib/es2019-object.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/object/from-entries"); 4 | -------------------------------------------------------------------------------- /lib/es2019-symbol.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/symbol/description"); 4 | -------------------------------------------------------------------------------- /lib/es2020-global-this.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/global-this"); 4 | -------------------------------------------------------------------------------- /lib/es2020-promise.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/promise/all-settled"); 4 | -------------------------------------------------------------------------------- /lib/es2020-string.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/string/match-all"); 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | official-lib-declarations/ 2 | src/ 3 | .travis.yml 4 | build.ps1 5 | rollup.config.js 6 | rollup.config.min.js 7 | tsconfig.json 8 | yarn.lock 9 | -------------------------------------------------------------------------------- /types/es2015-collection.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/map'; 2 | import 'core-js/es/weak-map'; 3 | import 'core-js/es/set'; 4 | import 'core-js/es/weak-set'; 5 | -------------------------------------------------------------------------------- /lib/es2018-async-iterable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/symbol/async-iterator"); 4 | -------------------------------------------------------------------------------- /lib/es2020-symbol-wellknown.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/string/match-all"); 4 | -------------------------------------------------------------------------------- /types/es2017-object.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/object/values'; 2 | import 'core-js/es/object/entries'; 3 | import 'core-js/es/object/get-own-property-descriptors'; 4 | -------------------------------------------------------------------------------- /lib/es2019-array.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/array/flat-map"); 4 | require("core-js/es/array/flat"); 5 | -------------------------------------------------------------------------------- /lib/es2017-string.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/string/pad-start"); 4 | require("core-js/es/string/pad-end"); 5 | -------------------------------------------------------------------------------- /types/es2019-string.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/string/trim-end'; 2 | import 'core-js/es/string/trim-start'; 3 | import 'core-js/es/string/trim-left'; 4 | import 'core-js/es/string/trim-right'; 5 | -------------------------------------------------------------------------------- /lib/es2016-array-include.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/array/includes"); 4 | require("core-js/es/typed-array/includes"); 5 | -------------------------------------------------------------------------------- /lib/es2015-collection.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/map"); 4 | require("core-js/es/weak-map"); 5 | require("core-js/es/set"); 6 | require("core-js/es/weak-set"); 7 | -------------------------------------------------------------------------------- /lib/es2017-object.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/object/values"); 4 | require("core-js/es/object/entries"); 5 | require("core-js/es/object/get-own-property-descriptors"); 6 | -------------------------------------------------------------------------------- /lib/es2019-string.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/string/trim-end"); 4 | require("core-js/es/string/trim-start"); 5 | require("core-js/es/string/trim-left"); 6 | require("core-js/es/string/trim-right"); 7 | -------------------------------------------------------------------------------- /types/es2015-symbol.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/object/to-string'; 2 | import 'core-js/es/array/concat'; 3 | import 'core-js/es/array/filter'; 4 | import 'core-js/es/array/map'; 5 | import 'core-js/es/array/slice'; 6 | import 'core-js/es/array/splice'; 7 | import 'core-js/modules/es.symbol'; 8 | import 'core-js/es/symbol/for'; 9 | import 'core-js/es/symbol/key-for'; 10 | -------------------------------------------------------------------------------- /types/index.d.ts: -------------------------------------------------------------------------------- 1 | import './es2015-collection'; 2 | import './es2015-core'; 3 | import './es2015-promise'; 4 | import './es2016-array-include'; 5 | import './es2017-object'; 6 | import './es2017-string'; 7 | import './es2018-promise'; 8 | import './es2019-array'; 9 | import './es2019-object'; 10 | import './es2019-string'; 11 | import './es2020-promise'; 12 | import './es2020-global-this'; 13 | import './es2020-string'; 14 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import './es2015-collection'; 2 | import './es2015-core'; 3 | import './es2015-promise'; 4 | 5 | import './es2016-array-include'; 6 | 7 | import './es2017-object'; 8 | import './es2017-string'; 9 | 10 | import './es2018-promise'; 11 | 12 | import './es2019-array'; 13 | import './es2019-object'; 14 | import './es2019-string'; 15 | 16 | import './es2020-promise'; 17 | import './es2020-global-this'; 18 | import './es2020-string'; 19 | -------------------------------------------------------------------------------- /lib/es2015-symbol.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/object/to-string"); 4 | require("core-js/es/array/concat"); 5 | require("core-js/es/array/filter"); 6 | require("core-js/es/array/map"); 7 | require("core-js/es/array/slice"); 8 | require("core-js/es/array/splice"); 9 | require("core-js/modules/es.symbol"); 10 | require("core-js/es/symbol/for"); 11 | require("core-js/es/symbol/key-for"); 12 | -------------------------------------------------------------------------------- /types/es2017-typed-arrays.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/typed-array/int8-array'; 2 | import 'core-js/es/typed-array/uint8-array'; 3 | import 'core-js/es/typed-array/uint8-clamped-array'; 4 | import 'core-js/es/typed-array/int16-array'; 5 | import 'core-js/es/typed-array/uint16-array'; 6 | import 'core-js/es/typed-array/int32-array'; 7 | import 'core-js/es/typed-array/uint32-array'; 8 | import 'core-js/es/typed-array/float32-array'; 9 | import 'core-js/es/typed-array/float64-array'; 10 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("./es2015-collection"); 4 | require("./es2015-core"); 5 | require("./es2015-promise"); 6 | require("./es2016-array-include"); 7 | require("./es2017-object"); 8 | require("./es2017-string"); 9 | require("./es2018-promise"); 10 | require("./es2019-array"); 11 | require("./es2019-object"); 12 | require("./es2019-string"); 13 | require("./es2020-promise"); 14 | require("./es2020-global-this"); 15 | require("./es2020-string"); 16 | -------------------------------------------------------------------------------- /lib/es2017-typed-arrays.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/typed-array/int8-array"); 4 | require("core-js/es/typed-array/uint8-array"); 5 | require("core-js/es/typed-array/uint8-clamped-array"); 6 | require("core-js/es/typed-array/int16-array"); 7 | require("core-js/es/typed-array/uint16-array"); 8 | require("core-js/es/typed-array/int32-array"); 9 | require("core-js/es/typed-array/uint32-array"); 10 | require("core-js/es/typed-array/float32-array"); 11 | require("core-js/es/typed-array/float64-array"); 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Ryan Elian 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /types/es2015-reflect.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/reflect/apply'; 2 | import 'core-js/es/reflect/construct'; 3 | import 'core-js/es/reflect/define-property'; 4 | import 'core-js/es/reflect/delete-property'; 5 | import 'core-js/es/reflect/get'; 6 | import 'core-js/es/reflect/get-own-property-descriptor'; 7 | import 'core-js/es/reflect/get-prototype-of'; 8 | import 'core-js/es/reflect/has'; 9 | import 'core-js/es/reflect/is-extensible'; 10 | import 'core-js/es/reflect/own-keys'; 11 | import 'core-js/es/reflect/prevent-extensions'; 12 | import 'core-js/es/reflect/set'; 13 | import 'core-js/es/reflect/set-prototype-of'; 14 | -------------------------------------------------------------------------------- /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | strategy: 11 | matrix: 12 | node-version: [10.x, 12.x] 13 | 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - name: npm install, build, and test 21 | run: | 22 | npm install -g yarn 23 | yarn 24 | yarn build 25 | # npm test 26 | env: 27 | CI: true 28 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import commonjs from '@rollup/plugin-commonjs'; 2 | import resolve from '@rollup/plugin-node-resolve'; 3 | import { terser } from 'rollup-plugin-terser'; 4 | import filesize from 'rollup-plugin-filesize'; 5 | 6 | export default { 7 | input: './lib/index.js', 8 | output: [{ 9 | file: './dist/ts-polyfill.js', 10 | format: 'iife', 11 | name: 'tsPolyfill' 12 | }, { 13 | file: './dist/ts-polyfill.min.js', 14 | format: 'iife', 15 | name: 'tsPolyfill', 16 | sourcemap: true, 17 | plugins: [terser(), filesize()] 18 | }], 19 | plugins: [resolve(), commonjs()] 20 | } 21 | -------------------------------------------------------------------------------- /src/es2020-global-this.ts: -------------------------------------------------------------------------------- 1 | // this is a special-case polyfill for ES2020 globalThis object reference 2 | // TypeScript does NOT transpile globalThis call when targeting earlier ES reference. 3 | // However, NO lib is provided for globalThis: 4 | 5 | // https://devblogs.microsoft.com/typescript/announcing-typescript-3-4/#type-checking-for-globalthis 6 | // It’s also important to note that TypeScript doesn’t transform references to globalThis 7 | // when compiling to older versions of ECMAScript. As such, unless you’re targeting evergreen browsers 8 | // (which already support globalThis), you may want to use an appropriate polyfill instead. 9 | 10 | import 'core-js/es/global-this'; 11 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "noImplicitAny": false, 5 | "noImplicitReturns": true, 6 | "noFallthroughCasesInSwitch": true, 7 | "allowSyntheticDefaultImports": true, 8 | 9 | "outDir": "lib", 10 | "removeComments": true, 11 | 12 | "target": "ES5", 13 | "module": "CommonJS", 14 | "moduleResolution": "Node", 15 | "importHelpers": false, 16 | 17 | "declaration": true, 18 | "declarationDir": "types", 19 | 20 | "lib": [ 21 | "ES5" 22 | ] 23 | }, 24 | "exclude": [ 25 | "dist", 26 | "lib", 27 | "official-lib-declarations", 28 | "node_modules", 29 | "types" 30 | ] 31 | } -------------------------------------------------------------------------------- /lib/es2015-reflect.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/reflect/apply"); 4 | require("core-js/es/reflect/construct"); 5 | require("core-js/es/reflect/define-property"); 6 | require("core-js/es/reflect/delete-property"); 7 | require("core-js/es/reflect/get"); 8 | require("core-js/es/reflect/get-own-property-descriptor"); 9 | require("core-js/es/reflect/get-prototype-of"); 10 | require("core-js/es/reflect/has"); 11 | require("core-js/es/reflect/is-extensible"); 12 | require("core-js/es/reflect/own-keys"); 13 | require("core-js/es/reflect/prevent-extensions"); 14 | require("core-js/es/reflect/set"); 15 | require("core-js/es/reflect/set-prototype-of"); 16 | -------------------------------------------------------------------------------- /types/es2015-symbol-wellknown.d.ts: -------------------------------------------------------------------------------- 1 | import './es2015-symbol'; 2 | import 'core-js/es/symbol/has-instance'; 3 | import 'core-js/es/symbol/is-concat-spreadable'; 4 | import 'core-js/es/symbol/match'; 5 | import 'core-js/es/symbol/replace'; 6 | import 'core-js/es/symbol/search'; 7 | import 'core-js/es/symbol/species'; 8 | import 'core-js/es/symbol/split'; 9 | import 'core-js/es/symbol/to-primitive'; 10 | import 'core-js/es/symbol/to-string-tag'; 11 | import 'core-js/es/json/to-string-tag'; 12 | import 'core-js/es/symbol/unscopables'; 13 | import 'core-js/es/date/to-primitive'; 14 | import 'core-js/es/function/has-instance'; 15 | import 'core-js/es/math/to-string-tag'; 16 | import 'core-js/es/string/match'; 17 | import 'core-js/es/string/replace'; 18 | import 'core-js/es/string/search'; 19 | import 'core-js/es/string/split'; 20 | -------------------------------------------------------------------------------- /lib/es2015-symbol-wellknown.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("./es2015-symbol"); 4 | require("core-js/es/symbol/has-instance"); 5 | require("core-js/es/symbol/is-concat-spreadable"); 6 | require("core-js/es/symbol/match"); 7 | require("core-js/es/symbol/replace"); 8 | require("core-js/es/symbol/search"); 9 | require("core-js/es/symbol/species"); 10 | require("core-js/es/symbol/split"); 11 | require("core-js/es/symbol/to-primitive"); 12 | require("core-js/es/symbol/to-string-tag"); 13 | require("core-js/es/json/to-string-tag"); 14 | require("core-js/es/symbol/unscopables"); 15 | require("core-js/es/date/to-primitive"); 16 | require("core-js/es/function/has-instance"); 17 | require("core-js/es/math/to-string-tag"); 18 | require("core-js/es/string/match"); 19 | require("core-js/es/string/replace"); 20 | require("core-js/es/string/search"); 21 | require("core-js/es/string/split"); 22 | -------------------------------------------------------------------------------- /types/es2015-iterable.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/symbol/iterator'; 2 | import 'core-js/es/array/iterator'; 3 | import 'core-js/es/array/entries'; 4 | import 'core-js/es/array/keys'; 5 | import 'core-js/es/array/values'; 6 | import 'core-js/es/array/from'; 7 | import 'core-js/es/string/iterator'; 8 | import 'core-js/es/typed-array/iterator'; 9 | import 'core-js/es/typed-array/entries'; 10 | import 'core-js/es/typed-array/keys'; 11 | import 'core-js/es/typed-array/values'; 12 | import 'core-js/es/typed-array/int8-array'; 13 | import 'core-js/es/typed-array/from'; 14 | import 'core-js/es/typed-array/uint8-array'; 15 | import 'core-js/es/typed-array/uint8-clamped-array'; 16 | import 'core-js/es/typed-array/int16-array'; 17 | import 'core-js/es/typed-array/uint16-array'; 18 | import 'core-js/es/typed-array/int32-array'; 19 | import 'core-js/es/typed-array/uint32-array'; 20 | import 'core-js/es/typed-array/float32-array'; 21 | import 'core-js/es/typed-array/float64-array'; 22 | -------------------------------------------------------------------------------- /lib/es2015-iterable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/symbol/iterator"); 4 | require("core-js/es/array/iterator"); 5 | require("core-js/es/array/entries"); 6 | require("core-js/es/array/keys"); 7 | require("core-js/es/array/values"); 8 | require("core-js/es/array/from"); 9 | require("core-js/es/string/iterator"); 10 | require("core-js/es/typed-array/iterator"); 11 | require("core-js/es/typed-array/entries"); 12 | require("core-js/es/typed-array/keys"); 13 | require("core-js/es/typed-array/values"); 14 | require("core-js/es/typed-array/int8-array"); 15 | require("core-js/es/typed-array/from"); 16 | require("core-js/es/typed-array/uint8-array"); 17 | require("core-js/es/typed-array/uint8-clamped-array"); 18 | require("core-js/es/typed-array/int16-array"); 19 | require("core-js/es/typed-array/uint16-array"); 20 | require("core-js/es/typed-array/int32-array"); 21 | require("core-js/es/typed-array/uint32-array"); 22 | require("core-js/es/typed-array/float32-array"); 23 | require("core-js/es/typed-array/float64-array"); 24 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | /// 23 | /// 24 | /// 25 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2019.symbol.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Symbol { 22 | /** 23 | * Expose the [[Description]] internal slot of a symbol directly. 24 | */ 25 | readonly description: string | undefined; 26 | } 27 | -------------------------------------------------------------------------------- /src/es2019-symbol.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // interface Symbol { 22 | // /** 23 | // * expose the [[Description]] internal slot of a symbol directly 24 | // */ 25 | // readonly description: string; 26 | // } 27 | 28 | import 'core-js/es/symbol/description'; 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ts-polyfill", 3 | "version": "3.9.3", 4 | "description": "Runtime polyfills for TypeScript libs, powered by core-js!", 5 | "keywords": [ 6 | "typescript", 7 | "javascript", 8 | "polyfill", 9 | "standard-library", 10 | "es6", 11 | "es2015", 12 | "promise" 13 | ], 14 | "homepage": "https://github.com/ryanelian/ts-polyfill#readme", 15 | "bugs": { 16 | "url": "https://github.com/ryanelian/ts-polyfill/issues", 17 | "email": "ryan.elian@accelist.com" 18 | }, 19 | "license": "Apache-2.0", 20 | "author": { 21 | "name": "Ryan Elian", 22 | "email": "ryan.elian@accelist.com" 23 | }, 24 | "main": "dist/ts-polyfill.js", 25 | "types": "types/index.d.ts", 26 | "repository": { 27 | "type": "git", 28 | "url": "https://github.com/ryanelian/ts-polyfill.git" 29 | }, 30 | "scripts": { 31 | "build": "tsc && rollup -c" 32 | }, 33 | "dependencies": { 34 | "core-js": "^3.6.5" 35 | }, 36 | "devDependencies": { 37 | "@rollup/plugin-commonjs": "^12.0.0", 38 | "@rollup/plugin-node-resolve": "^8.0.0", 39 | "rollup": "^2.10.9", 40 | "rollup-plugin-filesize": "^9.0.0", 41 | "rollup-plugin-terser": "^6.1.0", 42 | "typescript": "3.9.3" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2020.string.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | 23 | interface String { 24 | /** 25 | * Matches a string with a regular expression, and returns an iterable of matches 26 | * containing the results of that search. 27 | * @param regexp A variable name or string literal containing the regular expression pattern and flags. 28 | */ 29 | matchAll(regexp: RegExp): IterableIterator; 30 | } 31 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2017.intl.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | declare namespace Intl { 22 | type DateTimeFormatPartTypes = "day" | "dayPeriod" | "era" | "hour" | "literal" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year"; 23 | 24 | interface DateTimeFormatPart { 25 | type: DateTimeFormatPartTypes; 26 | value: string; 27 | } 28 | 29 | interface DateTimeFormat { 30 | formatToParts(date?: Date | number): DateTimeFormatPart[]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2018.regexp.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface RegExpMatchArray { 22 | groups?: { 23 | [key: string]: string 24 | } 25 | } 26 | 27 | interface RegExpExecArray { 28 | groups?: { 29 | [key: string]: string 30 | } 31 | } 32 | 33 | interface RegExp { 34 | /** 35 | * Returns a Boolean value indicating the state of the dotAll flag (s) used with a regular expression. 36 | * Default is false. Read-only. 37 | */ 38 | readonly dotAll: boolean; 39 | } -------------------------------------------------------------------------------- /src/es2020-string.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // /// 22 | 23 | // interface String { 24 | // /** 25 | // * Matches a string with a regular expression, and returns an iterable of matches 26 | // * containing the results of that search. 27 | // * @param regexp A variable name or string literal containing the regular expression pattern and flags. 28 | // */ 29 | // matchAll(regexp: RegExp): IterableIterator; 30 | // } 31 | 32 | import 'core-js/es/string/match-all'; 33 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2019.string.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface String { 22 | /** Removes the trailing white space and line terminator characters from a string. */ 23 | trimEnd(): string; 24 | 25 | /** Removes the leading white space and line terminator characters from a string. */ 26 | trimStart(): string; 27 | 28 | /** Removes the leading white space and line terminator characters from a string. */ 29 | trimLeft(): string; 30 | 31 | /** Removes the trailing white space and line terminator characters from a string. */ 32 | trimRight(): string; 33 | } 34 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2018.promise.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /** 22 | * Represents the completion of an asynchronous operation 23 | */ 24 | interface Promise { 25 | /** 26 | * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The 27 | * resolved value cannot be modified from the callback. 28 | * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). 29 | * @returns A Promise for the completion of the callback. 30 | */ 31 | finally(onfinally?: (() => void) | undefined | null): Promise 32 | } 33 | -------------------------------------------------------------------------------- /src/es2018-promise.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // /** 22 | // * Represents the completion of an asynchronous operation 23 | // */ 24 | // interface Promise { 25 | // /** 26 | // * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The 27 | // * resolved value cannot be modified from the callback. 28 | // * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). 29 | // * @returns A Promise for the completion of the callback. 30 | // */ 31 | // finally(onfinally?: (() => void) | undefined | null): Promise 32 | // } 33 | 34 | import 'core-js/es/promise/finally'; 35 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2019.object.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | 23 | interface ObjectConstructor { 24 | /** 25 | * Returns an object created by key-value entries for properties and methods 26 | * @param entries An iterable object that contains key-value entries for properties and methods. 27 | */ 28 | fromEntries(entries: Iterable): { [k: string]: T }; 29 | 30 | /** 31 | * Returns an object created by key-value entries for properties and methods 32 | * @param entries An iterable object that contains key-value entries for properties and methods. 33 | */ 34 | fromEntries(entries: Iterable): any; 35 | } 36 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2020.symbol.wellknown.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | /// 23 | 24 | interface SymbolConstructor { 25 | /** 26 | * A regular expression method that matches the regular expression against a string. Called 27 | * by the String.prototype.matchAll method. 28 | */ 29 | readonly matchAll: symbol; 30 | } 31 | 32 | interface RegExp { 33 | /** 34 | * Matches a string with this regular expression, and returns an iterable of matches 35 | * containing the results of that search. 36 | * @param string A string to search within. 37 | */ 38 | [Symbol.matchAll](str: string): IterableIterator; 39 | } 40 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2017.typedarrays.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Int8ArrayConstructor { 22 | new (): Int8Array; 23 | } 24 | 25 | interface Uint8ArrayConstructor { 26 | new (): Uint8Array; 27 | } 28 | 29 | interface Uint8ClampedArrayConstructor { 30 | new (): Uint8ClampedArray; 31 | } 32 | 33 | interface Int16ArrayConstructor { 34 | new (): Int16Array; 35 | } 36 | 37 | interface Uint16ArrayConstructor { 38 | new (): Uint16Array; 39 | } 40 | 41 | interface Int32ArrayConstructor { 42 | new (): Int32Array; 43 | } 44 | 45 | interface Uint32ArrayConstructor { 46 | new (): Uint32Array; 47 | } 48 | 49 | interface Float32ArrayConstructor { 50 | new (): Float32Array; 51 | } 52 | 53 | interface Float64ArrayConstructor { 54 | new (): Float64Array; 55 | } 56 | -------------------------------------------------------------------------------- /src/es2019-string.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // interface String { 22 | // /** Removes the trailing white space and line terminator characters from a string. */ 23 | // trimEnd(): string; 24 | 25 | import 'core-js/es/string/trim-end'; 26 | 27 | // /** Removes the leading white space and line terminator characters from a string. */ 28 | // trimStart(): string; 29 | 30 | import 'core-js/es/string/trim-start'; 31 | 32 | // /** Removes the trailing white space and line terminator characters from a string. */ 33 | // trimLeft(): string; 34 | 35 | import 'core-js/es/string/trim-left'; 36 | 37 | // /** Removes the leading white space and line terminator characters from a string. */ 38 | // trimRight(): string; 39 | // } 40 | 41 | import 'core-js/es/string/trim-right'; 42 | -------------------------------------------------------------------------------- /src/es2019-object.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // /// 22 | 23 | // interface ObjectConstructor { 24 | // /** 25 | // * Returns an object created by key-value entries for properties and methods 26 | // * @param entries An iterable object that contains key-value entries for properties and methods. 27 | // */ 28 | // fromEntries(entries: Iterable): { [k in PropertyKey]: T }; 29 | 30 | // /** 31 | // * Returns an object created by key-value entries for properties and methods 32 | // * @param entries An iterable object that contains key-value entries for properties and methods. 33 | // */ 34 | // fromEntries(entries: Iterable): any; 35 | // } 36 | 37 | import 'core-js/es/object/from-entries'; 38 | -------------------------------------------------------------------------------- /src/es2020-symbol-wellknown.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // /// 22 | // /// 23 | 24 | // interface SymbolConstructor { 25 | // /** 26 | // * A regular expression method that matches the regular expression against a string. Called 27 | // * by the String.prototype.matchAll method. 28 | // */ 29 | // readonly matchAll: symbol; 30 | // } 31 | 32 | // interface RegExp { 33 | // /** 34 | // * Matches a string with this regular expression, and returns an iterable of matches 35 | // * containing the results of that search. 36 | // * @param string A string to search within. 37 | // */ 38 | // [Symbol.matchAll](str: string): IterableIterator; 39 | // } 40 | 41 | import 'core-js/es/string/match-all'; 42 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2015.symbol.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface SymbolConstructor { 22 | /** 23 | * A reference to the prototype. 24 | */ 25 | readonly prototype: Symbol; 26 | 27 | /** 28 | * Returns a new unique Symbol value. 29 | * @param description Description of the new Symbol object. 30 | */ 31 | (description?: string | number): symbol; 32 | 33 | /** 34 | * Returns a Symbol object from the global symbol registry matching the given key if found. 35 | * Otherwise, returns a new symbol with this key. 36 | * @param key key to search for. 37 | */ 38 | for(key: string): symbol; 39 | 40 | /** 41 | * Returns a key from the global symbol registry matching the given Symbol if found. 42 | * Otherwise, returns a undefined. 43 | * @param sym Symbol to find the key for. 44 | */ 45 | keyFor(sym: symbol): string | undefined; 46 | } 47 | 48 | declare var Symbol: SymbolConstructor; -------------------------------------------------------------------------------- /src/es2018-async-iterable.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // /// 22 | // /// 23 | 24 | // interface SymbolConstructor { 25 | // /** 26 | // * A method that returns the default async iterator for an object. Called by the semantics of 27 | // * the for-await-of statement. 28 | // */ 29 | // readonly asyncIterator: symbol; 30 | // } 31 | 32 | // interface AsyncIterator { 33 | // next(value?: any): Promise>; 34 | // return?(value?: any): Promise>; 35 | // throw?(e?: any): Promise>; 36 | // } 37 | 38 | // interface AsyncIterable { 39 | // [Symbol.asyncIterator](): AsyncIterator; 40 | // } 41 | 42 | // interface AsyncIterableIterator extends AsyncIterator { 43 | // [Symbol.asyncIterator](): AsyncIterableIterator; 44 | // } 45 | 46 | import 'core-js/es/symbol/async-iterator'; 47 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2018.asynciterable.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | /// 23 | 24 | interface SymbolConstructor { 25 | /** 26 | * A method that returns the default async iterator for an object. Called by the semantics of 27 | * the for-await-of statement. 28 | */ 29 | readonly asyncIterator: symbol; 30 | } 31 | 32 | interface AsyncIterator { 33 | // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. 34 | next(...args: [] | [TNext]): Promise>; 35 | return?(value?: TReturn | PromiseLike): Promise>; 36 | throw?(e?: any): Promise>; 37 | } 38 | 39 | interface AsyncIterable { 40 | [Symbol.asyncIterator](): AsyncIterator; 41 | } 42 | 43 | interface AsyncIterableIterator extends AsyncIterator { 44 | [Symbol.asyncIterator](): AsyncIterableIterator; 45 | } -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2015.reflect.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | declare namespace Reflect { 22 | function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; 23 | function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; 24 | function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; 25 | function deleteProperty(target: object, propertyKey: PropertyKey): boolean; 26 | function get(target: object, propertyKey: PropertyKey, receiver?: any): any; 27 | function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined; 28 | function getPrototypeOf(target: object): object; 29 | function has(target: object, propertyKey: PropertyKey): boolean; 30 | function isExtensible(target: object): boolean; 31 | function ownKeys(target: object): PropertyKey[]; 32 | function preventExtensions(target: object): boolean; 33 | function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 34 | function setPrototypeOf(target: object, proto: any): boolean; 35 | } 36 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2020.promise.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface PromiseFulfilledResult { 22 | status: "fulfilled"; 23 | value: T; 24 | } 25 | 26 | interface PromiseRejectedResult { 27 | status: "rejected"; 28 | reason: any; 29 | } 30 | 31 | type PromiseSettledResult = PromiseFulfilledResult | PromiseRejectedResult; 32 | 33 | interface PromiseConstructor { 34 | /** 35 | * Creates a Promise that is resolved with an array of results when all 36 | * of the provided Promises resolve or reject. 37 | * @param values An array of Promises. 38 | * @returns A new Promise. 39 | */ 40 | allSettled(values: T): 41 | Promise<{ -readonly [P in keyof T]: PromiseSettledResult ? U : T[P]> }>; 42 | 43 | /** 44 | * Creates a Promise that is resolved with an array of results when all 45 | * of the provided Promises resolve or reject. 46 | * @param values An array of Promises. 47 | * @returns A new Promise. 48 | */ 49 | allSettled(values: Iterable): Promise ? U : T>[]>; 50 | } 51 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2015.proxy.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface ProxyHandler { 22 | getPrototypeOf? (target: T): object | null; 23 | setPrototypeOf? (target: T, v: any): boolean; 24 | isExtensible? (target: T): boolean; 25 | preventExtensions? (target: T): boolean; 26 | getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; 27 | has? (target: T, p: PropertyKey): boolean; 28 | get? (target: T, p: PropertyKey, receiver: any): any; 29 | set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; 30 | deleteProperty? (target: T, p: PropertyKey): boolean; 31 | defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; 32 | enumerate? (target: T): PropertyKey[]; 33 | ownKeys? (target: T): PropertyKey[]; 34 | apply? (target: T, thisArg: any, argArray?: any): any; 35 | construct? (target: T, argArray: any, newTarget?: any): object; 36 | } 37 | 38 | interface ProxyConstructor { 39 | revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; 40 | new (target: T, handler: ProxyHandler): T; 41 | } 42 | declare var Proxy: ProxyConstructor; 43 | -------------------------------------------------------------------------------- /src/es2020-promise.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // interface PromiseFulfilledResult { 22 | // status: "fulfilled"; 23 | // value: T; 24 | // } 25 | 26 | // interface PromiseRejectedResult { 27 | // status: "rejected"; 28 | // reason: any; 29 | // } 30 | 31 | // type PromiseSettledResult = PromiseFulfilledResult | PromiseRejectedResult; 32 | 33 | // interface PromiseConstructor { 34 | // /** 35 | // * Creates a Promise that is resolved with an array of results when all 36 | // * of the provided Promises resolve or reject. 37 | // * @param values An array of Promises. 38 | // * @returns A new Promise. 39 | // */ 40 | // allSettled(values: T): 41 | // Promise<{ -readonly [P in keyof T]: PromiseSettledResult ? U : T[P]> }>; 42 | 43 | // /** 44 | // * Creates a Promise that is resolved with an array of results when all 45 | // * of the provided Promises resolve or reject. 46 | // * @param values An array of Promises. 47 | // * @returns A new Promise. 48 | // */ 49 | // allSettled(values: Iterable): Promise ? U : T>[]>; 50 | // } 51 | 52 | import 'core-js/es/promise/all-settled'; 53 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2018.intl.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | declare namespace Intl { 22 | 23 | // http://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories 24 | type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other"; 25 | type PluralRuleType = "cardinal" | "ordinal"; 26 | 27 | interface PluralRulesOptions { 28 | localeMatcher?: "lookup" | "best fit"; 29 | type?: PluralRuleType; 30 | minimumIntegerDigits?: number; 31 | minimumFractionDigits?: number; 32 | maximumFractionDigits?: number; 33 | minimumSignificantDigits?: number; 34 | maximumSignificantDigits?: number; 35 | } 36 | 37 | interface ResolvedPluralRulesOptions { 38 | locale: string; 39 | pluralCategories: LDMLPluralRule[]; 40 | type: PluralRuleType; 41 | minimumIntegerDigits: number; 42 | minimumFractionDigits: number; 43 | maximumFractionDigits: number; 44 | minimumSignificantDigits?: number; 45 | maximumSignificantDigits?: number; 46 | } 47 | 48 | interface PluralRules { 49 | resolvedOptions(): ResolvedPluralRulesOptions; 50 | select(n: number): LDMLPluralRule; 51 | } 52 | 53 | const PluralRules: { 54 | new (locales?: string | string[], options?: PluralRulesOptions): PluralRules; 55 | (locales?: string | string[], options?: PluralRulesOptions): PluralRules; 56 | supportedLocalesOf( 57 | locales: string | string[], 58 | options?: PluralRulesOptions, 59 | ): string[]; 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2017.string.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface String { 22 | /** 23 | * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. 24 | * The padding is applied from the start (left) of the current string. 25 | * 26 | * @param maxLength The length of the resulting string once the current string has been padded. 27 | * If this parameter is smaller than the current string's length, the current string will be returned as it is. 28 | * 29 | * @param fillString The string to pad the current string with. 30 | * If this string is too long, it will be truncated and the left-most part will be applied. 31 | * The default value for this parameter is " " (U+0020). 32 | */ 33 | padStart(maxLength: number, fillString?: string): string; 34 | 35 | /** 36 | * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. 37 | * The padding is applied from the end (right) of the current string. 38 | * 39 | * @param maxLength The length of the resulting string once the current string has been padded. 40 | * If this parameter is smaller than the current string's length, the current string will be returned as it is. 41 | * 42 | * @param fillString The string to pad the current string with. 43 | * If this string is too long, it will be truncated and the left-most part will be applied. 44 | * The default value for this parameter is " " (U+0020). 45 | */ 46 | padEnd(maxLength: number, fillString?: string): string; 47 | } 48 | -------------------------------------------------------------------------------- /src/es2017-typed-arrays.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray 17 | // Here's the thing. Despite new TypedArray(param) is available in IE10, new TypedArray() might not. 18 | // So need polyfill... 19 | // (Methods unique to ES2015 libraries are defined in es2015-core polyfills!) 20 | 21 | 22 | // /// 23 | 24 | 25 | // interface Int8ArrayConstructor { 26 | // new (): Int8Array; 27 | // } 28 | 29 | import 'core-js/es/typed-array/int8-array'; 30 | 31 | // interface Uint8ArrayConstructor { 32 | // new (): Uint8Array; 33 | // } 34 | 35 | import 'core-js/es/typed-array/uint8-array'; 36 | 37 | // interface Uint8ClampedArrayConstructor { 38 | // new (): Uint8ClampedArray; 39 | // } 40 | 41 | import 'core-js/es/typed-array/uint8-clamped-array'; 42 | 43 | // interface Int16ArrayConstructor { 44 | // new (): Int16Array; 45 | // } 46 | 47 | import 'core-js/es/typed-array/int16-array'; 48 | 49 | // interface Uint16ArrayConstructor { 50 | // new (): Uint16Array; 51 | // } 52 | 53 | import 'core-js/es/typed-array/uint16-array'; 54 | 55 | // interface Int32ArrayConstructor { 56 | // new (): Int32Array; 57 | // } 58 | 59 | import 'core-js/es/typed-array/int32-array'; 60 | 61 | // interface Uint32ArrayConstructor { 62 | // new (): Uint32Array; 63 | // } 64 | 65 | import 'core-js/es/typed-array/uint32-array'; 66 | 67 | // interface Float32ArrayConstructor { 68 | // new (): Float32Array; 69 | // } 70 | 71 | import 'core-js/es/typed-array/float32-array'; 72 | 73 | // interface Float64ArrayConstructor { 74 | // new (): Float64Array; 75 | // } 76 | 77 | import 'core-js/es/typed-array/float64-array'; 78 | -------------------------------------------------------------------------------- /types/es2015-core.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es/array/find'; 2 | import 'core-js/es/typed-array/find'; 3 | import 'core-js/es/array/find-index'; 4 | import 'core-js/es/typed-array/find-index'; 5 | import 'core-js/es/array/fill'; 6 | import 'core-js/es/typed-array/fill'; 7 | import 'core-js/es/array/copy-within'; 8 | import 'core-js/es/typed-array/copy-within'; 9 | import 'core-js/es/array/from'; 10 | import 'core-js/es/typed-array/from'; 11 | import 'core-js/es/array/of'; 12 | import 'core-js/es/typed-array/of'; 13 | import 'core-js/es/function/name'; 14 | import 'core-js/es/math/clz32'; 15 | import 'core-js/es/math/imul'; 16 | import 'core-js/es/math/sign'; 17 | import 'core-js/es/math/log10'; 18 | import 'core-js/es/math/log2'; 19 | import 'core-js/es/math/log1p'; 20 | import 'core-js/es/math/expm1'; 21 | import 'core-js/es/math/cosh'; 22 | import 'core-js/es/math/sinh'; 23 | import 'core-js/es/math/tanh'; 24 | import 'core-js/es/math/acosh'; 25 | import 'core-js/es/math/asinh'; 26 | import 'core-js/es/math/atanh'; 27 | import 'core-js/es/math/hypot'; 28 | import 'core-js/es/math/trunc'; 29 | import 'core-js/es/math/fround'; 30 | import 'core-js/es/math/cbrt'; 31 | import 'core-js/es/number/epsilon'; 32 | import 'core-js/es/number/is-finite'; 33 | import 'core-js/es/number/is-integer'; 34 | import 'core-js/es/number/is-nan'; 35 | import 'core-js/es/number/is-safe-integer'; 36 | import 'core-js/es/number/max-safe-integer'; 37 | import 'core-js/es/number/min-safe-integer'; 38 | import 'core-js/es/number/parse-float'; 39 | import 'core-js/es/number/parse-int'; 40 | import 'core-js/es/object/assign'; 41 | import 'core-js/es/object/get-own-property-symbols'; 42 | import 'core-js/es/object/is'; 43 | import 'core-js/es/object/set-prototype-of'; 44 | import 'core-js/es/object/is-frozen'; 45 | import 'core-js/es/regexp/flags'; 46 | import 'core-js/es/regexp/constructor'; 47 | import 'core-js/es/string/code-point-at'; 48 | import 'core-js/es/string/includes'; 49 | import 'core-js/es/string/ends-with'; 50 | import 'core-js/es/string/repeat'; 51 | import 'core-js/es/string/starts-with'; 52 | import 'core-js/es/string/anchor'; 53 | import 'core-js/es/string/anchor'; 54 | import 'core-js/es/string/blink'; 55 | import 'core-js/es/string/bold'; 56 | import 'core-js/es/string/fixed'; 57 | import 'core-js/es/string/fontcolor'; 58 | import 'core-js/es/string/fontsize'; 59 | import 'core-js/es/string/italics'; 60 | import 'core-js/es/string/link'; 61 | import 'core-js/es/string/small'; 62 | import 'core-js/es/string/strike'; 63 | import 'core-js/es/string/sub'; 64 | import 'core-js/es/string/sup'; 65 | import 'core-js/es/string/from-code-point'; 66 | import 'core-js/es/string/raw'; 67 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2017.object.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface ObjectConstructor { 22 | /** 23 | * Returns an array of values of the enumerable properties of an object 24 | * @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. 25 | */ 26 | values(o: { [s: string]: T } | ArrayLike): T[]; 27 | 28 | /** 29 | * Returns an array of values of the enumerable properties of an object 30 | * @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. 31 | */ 32 | values(o: {}): any[]; 33 | 34 | /** 35 | * Returns an array of key/values of the enumerable properties of an object 36 | * @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. 37 | */ 38 | entries(o: { [s: string]: T } | ArrayLike): [string, T][]; 39 | 40 | /** 41 | * Returns an array of key/values of the enumerable properties of an object 42 | * @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. 43 | */ 44 | entries(o: {}): [string, any][]; 45 | 46 | /** 47 | * Returns an object containing all own property descriptors of an object 48 | * @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. 49 | */ 50 | getOwnPropertyDescriptors(o: T): {[P in keyof T]: TypedPropertyDescriptor} & { [x: string]: PropertyDescriptor }; 51 | } 52 | -------------------------------------------------------------------------------- /src/es2015-reflect.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // declare namespace Reflect { 22 | // function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; 23 | // function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; 24 | // function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; 25 | // function deleteProperty(target: object, propertyKey: PropertyKey): boolean; 26 | // function get(target: object, propertyKey: PropertyKey, receiver?: any): any; 27 | // function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined; 28 | // function getPrototypeOf(target: object): object; 29 | // function has(target: object, propertyKey: PropertyKey): boolean; 30 | // function isExtensible(target: object): boolean; 31 | // function ownKeys(target: object): PropertyKey[]; 32 | // function preventExtensions(target: object): boolean; 33 | // function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 34 | // function setPrototypeOf(target: object, proto: any): boolean; 35 | // } 36 | 37 | import 'core-js/es/reflect/apply'; 38 | import 'core-js/es/reflect/construct'; 39 | import 'core-js/es/reflect/define-property'; 40 | import 'core-js/es/reflect/delete-property'; 41 | import 'core-js/es/reflect/get'; 42 | import 'core-js/es/reflect/get-own-property-descriptor'; 43 | import 'core-js/es/reflect/get-prototype-of'; 44 | import 'core-js/es/reflect/has'; 45 | import 'core-js/es/reflect/is-extensible'; 46 | import 'core-js/es/reflect/own-keys'; 47 | import 'core-js/es/reflect/prevent-extensions'; 48 | import 'core-js/es/reflect/set'; 49 | import 'core-js/es/reflect/set-prototype-of'; 50 | -------------------------------------------------------------------------------- /src/es2017-string.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // interface String { 22 | // /** 23 | // * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. 24 | // * The padding is applied from the start (left) of the current string. 25 | // * 26 | // * @param maxLength The length of the resulting string once the current string has been padded. 27 | // * If this parameter is smaller than the current string's length, the current string will be returned as it is. 28 | // * 29 | // * @param fillString The string to pad the current string with. 30 | // * If this string is too long, it will be truncated and the left-most part will be applied. 31 | // * The default value for this parameter is " " (U+0020). 32 | // */ 33 | // padStart(maxLength: number, fillString?: string): string; 34 | 35 | import 'core-js/es/string/pad-start'; 36 | 37 | // /** 38 | // * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. 39 | // * The padding is applied from the end (right) of the current string. 40 | // * 41 | // * @param maxLength The length of the resulting string once the current string has been padded. 42 | // * If this parameter is smaller than the current string's length, the current string will be returned as it is. 43 | // * 44 | // * @param fillString The string to pad the current string with. 45 | // * If this string is too long, it will be truncated and the left-most part will be applied. 46 | // * The default value for this parameter is " " (U+0020). 47 | // */ 48 | // padEnd(maxLength: number, fillString?: string): string; 49 | // } 50 | 51 | import 'core-js/es/string/pad-end'; 52 | -------------------------------------------------------------------------------- /lib/es2015-core.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | require("core-js/es/array/find"); 4 | require("core-js/es/typed-array/find"); 5 | require("core-js/es/array/find-index"); 6 | require("core-js/es/typed-array/find-index"); 7 | require("core-js/es/array/fill"); 8 | require("core-js/es/typed-array/fill"); 9 | require("core-js/es/array/copy-within"); 10 | require("core-js/es/typed-array/copy-within"); 11 | require("core-js/es/array/from"); 12 | require("core-js/es/typed-array/from"); 13 | require("core-js/es/array/of"); 14 | require("core-js/es/typed-array/of"); 15 | require("core-js/es/function/name"); 16 | require("core-js/es/math/clz32"); 17 | require("core-js/es/math/imul"); 18 | require("core-js/es/math/sign"); 19 | require("core-js/es/math/log10"); 20 | require("core-js/es/math/log2"); 21 | require("core-js/es/math/log1p"); 22 | require("core-js/es/math/expm1"); 23 | require("core-js/es/math/cosh"); 24 | require("core-js/es/math/sinh"); 25 | require("core-js/es/math/tanh"); 26 | require("core-js/es/math/acosh"); 27 | require("core-js/es/math/asinh"); 28 | require("core-js/es/math/atanh"); 29 | require("core-js/es/math/hypot"); 30 | require("core-js/es/math/trunc"); 31 | require("core-js/es/math/fround"); 32 | require("core-js/es/math/cbrt"); 33 | require("core-js/es/number/epsilon"); 34 | require("core-js/es/number/is-finite"); 35 | require("core-js/es/number/is-integer"); 36 | require("core-js/es/number/is-nan"); 37 | require("core-js/es/number/is-safe-integer"); 38 | require("core-js/es/number/max-safe-integer"); 39 | require("core-js/es/number/min-safe-integer"); 40 | require("core-js/es/number/parse-float"); 41 | require("core-js/es/number/parse-int"); 42 | require("core-js/es/object/assign"); 43 | require("core-js/es/object/get-own-property-symbols"); 44 | require("core-js/es/object/is"); 45 | require("core-js/es/object/set-prototype-of"); 46 | require("core-js/es/object/is-frozen"); 47 | require("core-js/es/regexp/flags"); 48 | require("core-js/es/regexp/constructor"); 49 | require("core-js/es/string/code-point-at"); 50 | require("core-js/es/string/includes"); 51 | require("core-js/es/string/ends-with"); 52 | require("core-js/es/string/repeat"); 53 | require("core-js/es/string/starts-with"); 54 | require("core-js/es/string/anchor"); 55 | require("core-js/es/string/anchor"); 56 | require("core-js/es/string/blink"); 57 | require("core-js/es/string/bold"); 58 | require("core-js/es/string/fixed"); 59 | require("core-js/es/string/fontcolor"); 60 | require("core-js/es/string/fontsize"); 61 | require("core-js/es/string/italics"); 62 | require("core-js/es/string/link"); 63 | require("core-js/es/string/small"); 64 | require("core-js/es/string/strike"); 65 | require("core-js/es/string/sub"); 66 | require("core-js/es/string/sup"); 67 | require("core-js/es/string/from-code-point"); 68 | require("core-js/es/string/raw"); 69 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2015.generator.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | 23 | interface Generator extends Iterator { 24 | // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. 25 | next(...args: [] | [TNext]): IteratorResult; 26 | return(value: TReturn): IteratorResult; 27 | throw(e: any): IteratorResult; 28 | [Symbol.iterator](): Generator; 29 | } 30 | 31 | interface GeneratorFunction { 32 | /** 33 | * Creates a new Generator object. 34 | * @param args A list of arguments the function accepts. 35 | */ 36 | new (...args: any[]): Generator; 37 | /** 38 | * Creates a new Generator object. 39 | * @param args A list of arguments the function accepts. 40 | */ 41 | (...args: any[]): Generator; 42 | /** 43 | * The length of the arguments. 44 | */ 45 | readonly length: number; 46 | /** 47 | * Returns the name of the function. 48 | */ 49 | readonly name: string; 50 | /** 51 | * A reference to the prototype. 52 | */ 53 | readonly prototype: Generator; 54 | } 55 | 56 | interface GeneratorFunctionConstructor { 57 | /** 58 | * Creates a new Generator function. 59 | * @param args A list of arguments the function accepts. 60 | */ 61 | new (...args: string[]): GeneratorFunction; 62 | /** 63 | * Creates a new Generator function. 64 | * @param args A list of arguments the function accepts. 65 | */ 66 | (...args: string[]): GeneratorFunction; 67 | /** 68 | * The length of the arguments. 69 | */ 70 | readonly length: number; 71 | /** 72 | * Returns the name of the function. 73 | */ 74 | readonly name: string; 75 | /** 76 | * A reference to the prototype. 77 | */ 78 | readonly prototype: GeneratorFunction; 79 | } 80 | -------------------------------------------------------------------------------- /src/es2017-object.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // interface ObjectConstructor { 22 | // /** 23 | // * Returns an array of values of the enumerable properties of an object 24 | // * @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. 25 | // */ 26 | // values(o: { [s: string]: T } | ArrayLike): T[]; 27 | 28 | // /** 29 | // * Returns an array of values of the enumerable properties of an object 30 | // * @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. 31 | // */ 32 | // values(o: {}): any[]; 33 | 34 | import 'core-js/es/object/values'; 35 | 36 | // /** 37 | // * Returns an array of key/values of the enumerable properties of an object 38 | // * @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. 39 | // */ 40 | // entries(o: { [s: string]: T } | ArrayLike): [string, T][]; 41 | 42 | // /** 43 | // * Returns an array of key/values of the enumerable properties of an object 44 | // * @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. 45 | // */ 46 | // entries(o: {}): [string, any][]; 47 | 48 | import 'core-js/es/object/entries'; 49 | 50 | // /** 51 | // * Returns an object containing all own property descriptors of an object 52 | // * @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. 53 | // */ 54 | // getOwnPropertyDescriptors(o: T): {[P in keyof T]: TypedPropertyDescriptor} & { [x: string]: PropertyDescriptor }; 55 | // } 56 | 57 | import 'core-js/es/object/get-own-property-descriptors'; 58 | -------------------------------------------------------------------------------- /src/es2015-symbol.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | import 'core-js/es/object/to-string'; // support @@toStringTag 21 | import 'core-js/es/array/concat'; // support @@isConcatSpreadable and @@species 22 | import 'core-js/es/array/filter'; // support @@species 23 | import 'core-js/es/array/map'; // support @@species 24 | import 'core-js/es/array/slice'; // support @@species 25 | import 'core-js/es/array/splice'; // support @@species 26 | 27 | // interface SymbolConstructor { 28 | // /** 29 | // * A reference to the prototype. 30 | // */ 31 | // readonly prototype: Symbol; 32 | 33 | /* 34 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 35 | Currently, core-js not adds setters to Object.prototype 36 | for well-known symbols for correct work something like Symbol.iterator in foo. 37 | It can cause problems with their enumerability. 38 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 39 | */ 40 | 41 | // /** 42 | // * Returns a new unique Symbol value. 43 | // * @param description Description of the new Symbol object. 44 | // */ 45 | // (description?: string | number): symbol; 46 | 47 | import 'core-js/modules/es.symbol'; // apparently constructor-only polyfill is hidden behind internal API?! 48 | 49 | // /** 50 | // * Returns a Symbol object from the global symbol registry matching the given key if found. 51 | // * Otherwise, returns a new symbol with this key. 52 | // * @param key key to search for. 53 | // */ 54 | // for(key: string): symbol; 55 | 56 | import 'core-js/es/symbol/for'; 57 | 58 | // /** 59 | // * Returns a key from the global symbol registry matching the given Symbol if found. 60 | // * Otherwise, returns a undefined. 61 | // * @param sym Symbol to find the key for. 62 | // */ 63 | // keyFor(sym: symbol): string | undefined; 64 | // } 65 | 66 | import 'core-js/es/symbol/key-for'; 67 | 68 | // declare var Symbol: SymbolConstructor; 69 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2018.asyncgenerator.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | /// 22 | 23 | interface AsyncGenerator extends AsyncIterator { 24 | // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. 25 | next(...args: [] | [TNext]): Promise>; 26 | return(value: TReturn | PromiseLike): Promise>; 27 | throw(e: any): Promise>; 28 | [Symbol.asyncIterator](): AsyncGenerator; 29 | } 30 | 31 | interface AsyncGeneratorFunction { 32 | /** 33 | * Creates a new AsyncGenerator object. 34 | * @param args A list of arguments the function accepts. 35 | */ 36 | new (...args: any[]): AsyncGenerator; 37 | /** 38 | * Creates a new AsyncGenerator object. 39 | * @param args A list of arguments the function accepts. 40 | */ 41 | (...args: any[]): AsyncGenerator; 42 | /** 43 | * The length of the arguments. 44 | */ 45 | readonly length: number; 46 | /** 47 | * Returns the name of the function. 48 | */ 49 | readonly name: string; 50 | /** 51 | * A reference to the prototype. 52 | */ 53 | readonly prototype: AsyncGenerator; 54 | } 55 | 56 | interface AsyncGeneratorFunctionConstructor { 57 | /** 58 | * Creates a new AsyncGenerator function. 59 | * @param args A list of arguments the function accepts. 60 | */ 61 | new (...args: string[]): AsyncGeneratorFunction; 62 | /** 63 | * Creates a new AsyncGenerator function. 64 | * @param args A list of arguments the function accepts. 65 | */ 66 | (...args: string[]): AsyncGeneratorFunction; 67 | /** 68 | * The length of the arguments. 69 | */ 70 | readonly length: number; 71 | /** 72 | * Returns the name of the function. 73 | */ 74 | readonly name: string; 75 | /** 76 | * A reference to the prototype. 77 | */ 78 | readonly prototype: AsyncGeneratorFunction; 79 | } 80 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2015.collection.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Map { 22 | clear(): void; 23 | delete(key: K): boolean; 24 | forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; 25 | get(key: K): V | undefined; 26 | has(key: K): boolean; 27 | set(key: K, value: V): this; 28 | readonly size: number; 29 | } 30 | 31 | interface MapConstructor { 32 | new(): Map; 33 | new(entries?: readonly (readonly [K, V])[] | null): Map; 34 | readonly prototype: Map; 35 | } 36 | declare var Map: MapConstructor; 37 | 38 | interface ReadonlyMap { 39 | forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; 40 | get(key: K): V | undefined; 41 | has(key: K): boolean; 42 | readonly size: number; 43 | } 44 | 45 | interface WeakMap { 46 | delete(key: K): boolean; 47 | get(key: K): V | undefined; 48 | has(key: K): boolean; 49 | set(key: K, value: V): this; 50 | } 51 | 52 | interface WeakMapConstructor { 53 | new (entries?: readonly [K, V][] | null): WeakMap; 54 | readonly prototype: WeakMap; 55 | } 56 | declare var WeakMap: WeakMapConstructor; 57 | 58 | interface Set { 59 | add(value: T): this; 60 | clear(): void; 61 | delete(value: T): boolean; 62 | forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; 63 | has(value: T): boolean; 64 | readonly size: number; 65 | } 66 | 67 | interface SetConstructor { 68 | new (values?: readonly T[] | null): Set; 69 | readonly prototype: Set; 70 | } 71 | declare var Set: SetConstructor; 72 | 73 | interface ReadonlySet { 74 | forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; 75 | has(value: T): boolean; 76 | readonly size: number; 77 | } 78 | 79 | interface WeakSet { 80 | add(value: T): this; 81 | delete(value: T): boolean; 82 | has(value: T): boolean; 83 | } 84 | 85 | interface WeakSetConstructor { 86 | new (values?: readonly T[] | null): WeakSet; 87 | readonly prototype: WeakSet; 88 | } 89 | declare var WeakSet: WeakSetConstructor; 90 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2019.array.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | type FlatArray = { 22 | "done": Arr, 23 | "recur": Arr extends ReadonlyArray 24 | ? FlatArray 25 | : Arr 26 | }[Depth extends -1 ? "done" : "recur"]; 27 | 28 | interface ReadonlyArray { 29 | 30 | /** 31 | * Calls a defined callback function on each element of an array. Then, flattens the result into 32 | * a new array. 33 | * This is identical to a map followed by flat with depth 1. 34 | * 35 | * @param callback A function that accepts up to three arguments. The flatMap method calls the 36 | * callback function one time for each element in the array. 37 | * @param thisArg An object to which the this keyword can refer in the callback function. If 38 | * thisArg is omitted, undefined is used as the this value. 39 | */ 40 | flatMap ( 41 | callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, 42 | thisArg?: This 43 | ): U[] 44 | 45 | 46 | /** 47 | * Returns a new array with all sub-array elements concatenated into it recursively up to the 48 | * specified depth. 49 | * 50 | * @param depth The maximum recursion depth 51 | */ 52 | flat( 53 | this: A, 54 | depth?: D 55 | ): FlatArray[] 56 | } 57 | 58 | interface Array { 59 | 60 | /** 61 | * Calls a defined callback function on each element of an array. Then, flattens the result into 62 | * a new array. 63 | * This is identical to a map followed by flat with depth 1. 64 | * 65 | * @param callback A function that accepts up to three arguments. The flatMap method calls the 66 | * callback function one time for each element in the array. 67 | * @param thisArg An object to which the this keyword can refer in the callback function. If 68 | * thisArg is omitted, undefined is used as the this value. 69 | */ 70 | flatMap ( 71 | callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, 72 | thisArg?: This 73 | ): U[] 74 | 75 | /** 76 | * Returns a new array with all sub-array elements concatenated into it recursively up to the 77 | * specified depth. 78 | * 79 | * @param depth The maximum recursion depth 80 | */ 81 | flat( 82 | this: A, 83 | depth?: D 84 | ): FlatArray[] 85 | } 86 | -------------------------------------------------------------------------------- /src/es2015-collection.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // interface Map { 22 | // clear(): void; 23 | // delete(key: K): boolean; 24 | // forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void; 25 | // get(key: K): V | undefined; 26 | // has(key: K): boolean; 27 | // set(key: K, value: V): this; 28 | // readonly size: number; 29 | // } 30 | 31 | // interface MapConstructor { 32 | // new(): Map; 33 | // new(entries?: ReadonlyArray | null): Map; 34 | // readonly prototype: Map; 35 | // } 36 | // declare var Map: MapConstructor; 37 | 38 | // interface ReadonlyMap { 39 | // forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void; 40 | // get(key: K): V | undefined; 41 | // has(key: K): boolean; 42 | // readonly size: number; 43 | // } 44 | 45 | import 'core-js/es/map'; 46 | 47 | // interface WeakMap { 48 | // delete(key: K): boolean; 49 | // get(key: K): V | undefined; 50 | // has(key: K): boolean; 51 | // set(key: K, value: V): this; 52 | // } 53 | 54 | // interface WeakMapConstructor { 55 | // new (entries?: ReadonlyArray<[K, V]> | null): WeakMap; 56 | // readonly prototype: WeakMap; 57 | // } 58 | // declare var WeakMap: WeakMapConstructor; 59 | 60 | import 'core-js/es/weak-map'; 61 | 62 | // interface Set { 63 | // add(value: T): this; 64 | // clear(): void; 65 | // delete(value: T): boolean; 66 | // forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void; 67 | // has(value: T): boolean; 68 | // readonly size: number; 69 | // } 70 | 71 | // interface SetConstructor { 72 | // new (values?: ReadonlyArray | null): Set; 73 | // readonly prototype: Set; 74 | // } 75 | // declare var Set: SetConstructor; 76 | 77 | // interface ReadonlySet { 78 | // forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void; 79 | // has(value: T): boolean; 80 | // readonly size: number; 81 | // } 82 | 83 | import 'core-js/es/set'; 84 | 85 | // interface WeakSet { 86 | // add(value: T): this; 87 | // delete(value: T): boolean; 88 | // has(value: T): boolean; 89 | // } 90 | 91 | // interface WeakSetConstructor { 92 | // new (values?: ReadonlyArray | null): WeakSet; 93 | // readonly prototype: WeakSet; 94 | // } 95 | // declare var WeakSet: WeakSetConstructor; 96 | 97 | import 'core-js/es/weak-set'; 98 | -------------------------------------------------------------------------------- /update-libs.ps1: -------------------------------------------------------------------------------- 1 | # https://www.typescriptlang.org/docs/handbook/compiler-options.html 2 | 3 | Copy-Item .\node_modules\typescript\lib\lib.d.ts -Destination .\official-lib-declarations\lib.d.ts 4 | Copy-Item .\node_modules\typescript\lib\lib.dom.d.ts -Destination .\official-lib-declarations\lib.dom.d.ts 5 | Copy-Item .\node_modules\typescript\lib\lib.dom.iterable.d.ts -Destination .\official-lib-declarations\lib.dom.iterable.d.ts 6 | 7 | Copy-Item .\node_modules\typescript\lib\lib.es2015.core.d.ts -Destination .\official-lib-declarations\lib.es2015.core.d.ts 8 | Copy-Item .\node_modules\typescript\lib\lib.es2015.collection.d.ts -Destination .\official-lib-declarations\lib.es2015.collection.d.ts 9 | Copy-Item .\node_modules\typescript\lib\lib.es2015.generator.d.ts -Destination .\official-lib-declarations\lib.es2015.generator.d.ts 10 | Copy-Item .\node_modules\typescript\lib\lib.es2015.iterable.d.ts -Destination .\official-lib-declarations\lib.es2015.iterable.d.ts 11 | Copy-Item .\node_modules\typescript\lib\lib.es2015.promise.d.ts -Destination .\official-lib-declarations\lib.es2015.promise.d.ts 12 | Copy-Item .\node_modules\typescript\lib\lib.es2015.proxy.d.ts -Destination .\official-lib-declarations\lib.es2015.proxy.d.ts 13 | Copy-Item .\node_modules\typescript\lib\lib.es2015.reflect.d.ts -Destination .\official-lib-declarations\lib.es2015.reflect.d.ts 14 | Copy-Item .\node_modules\typescript\lib\lib.es2015.symbol.d.ts -Destination .\official-lib-declarations\lib.es2015.symbol.d.ts 15 | Copy-Item .\node_modules\typescript\lib\lib.es2015.symbol.wellknown.d.ts -Destination .\official-lib-declarations\lib.es2015.symbol.wellknown.d.ts 16 | 17 | Copy-Item .\node_modules\typescript\lib\lib.es2016.array.include.d.ts -Destination .\official-lib-declarations\lib.es2016.array.include.d.ts 18 | 19 | Copy-Item .\node_modules\typescript\lib\lib.es2017.object.d.ts -Destination .\official-lib-declarations\lib.es2017.object.d.ts 20 | Copy-Item .\node_modules\typescript\lib\lib.es2017.intl.d.ts -Destination .\official-lib-declarations\lib.es2017.intl.d.ts 21 | Copy-Item .\node_modules\typescript\lib\lib.es2017.sharedmemory.d.ts -Destination .\official-lib-declarations\lib.es2017.sharedmemory.d.ts 22 | Copy-Item .\node_modules\typescript\lib\lib.es2017.string.d.ts -Destination .\official-lib-declarations\lib.es2017.string.d.ts 23 | Copy-Item .\node_modules\typescript\lib\lib.es2017.typedarrays.d.ts -Destination .\official-lib-declarations\lib.es2017.typedarrays.d.ts 24 | 25 | Copy-Item .\node_modules\typescript\lib\lib.es2018.asynciterable.d.ts -Destination .\official-lib-declarations\lib.es2018.asynciterable.d.ts 26 | Copy-Item .\node_modules\typescript\lib\lib.es2018.asyncgenerator.d.ts -Destination .\official-lib-declarations\lib.es2018.asyncgenerator.d.ts 27 | Copy-Item .\node_modules\typescript\lib\lib.es2018.intl.d.ts -Destination .\official-lib-declarations\lib.es2018.intl.d.ts 28 | Copy-Item .\node_modules\typescript\lib\lib.es2018.promise.d.ts -Destination .\official-lib-declarations\lib.es2018.promise.d.ts 29 | Copy-Item .\node_modules\typescript\lib\lib.es2018.regexp.d.ts -Destination .\official-lib-declarations\lib.es2018.regexp.d.ts 30 | 31 | Copy-Item .\node_modules\typescript\lib\lib.es2019.array.d.ts -Destination .\official-lib-declarations\lib.es2019.array.d.ts 32 | Copy-Item .\node_modules\typescript\lib\lib.es2019.string.d.ts -Destination .\official-lib-declarations\lib.es2019.string.d.ts 33 | Copy-Item .\node_modules\typescript\lib\lib.es2019.symbol.d.ts -Destination .\official-lib-declarations\lib.es2019.symbol.d.ts 34 | Copy-Item .\node_modules\typescript\lib\lib.es2019.object.d.ts -Destination .\official-lib-declarations\lib.es2019.object.d.ts 35 | 36 | Copy-Item .\node_modules\typescript\lib\lib.es2020.bigint.d.ts -Destination .\official-lib-declarations\lib.es2020.bigint.d.ts 37 | Copy-Item .\node_modules\typescript\lib\lib.es2020.promise.d.ts -Destination .\official-lib-declarations\lib.es2020.promise.d.ts 38 | Copy-Item .\node_modules\typescript\lib\lib.es2020.string.d.ts -Destination .\official-lib-declarations\lib.es2020.string.d.ts 39 | Copy-Item .\node_modules\typescript\lib\lib.es2020.symbol.wellknown.d.ts -Destination .\official-lib-declarations\lib.es2020.symbol.wellknown.d.ts 40 | -------------------------------------------------------------------------------- /official-lib-declarations/lib.es2016.array.include.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | 17 | 18 | /// 19 | 20 | 21 | interface Array { 22 | /** 23 | * Determines whether an array includes a certain element, returning true or false as appropriate. 24 | * @param searchElement The element to search for. 25 | * @param fromIndex The position in this array at which to begin searching for searchElement. 26 | */ 27 | includes(searchElement: T, fromIndex?: number): boolean; 28 | } 29 | 30 | interface ReadonlyArray { 31 | /** 32 | * Determines whether an array includes a certain element, returning true or false as appropriate. 33 | * @param searchElement The element to search for. 34 | * @param fromIndex The position in this array at which to begin searching for searchElement. 35 | */ 36 | includes(searchElement: T, fromIndex?: number): boolean; 37 | } 38 | 39 | interface Int8Array { 40 | /** 41 | * Determines whether an array includes a certain element, returning true or false as appropriate. 42 | * @param searchElement The element to search for. 43 | * @param fromIndex The position in this array at which to begin searching for searchElement. 44 | */ 45 | includes(searchElement: number, fromIndex?: number): boolean; 46 | } 47 | 48 | interface Uint8Array { 49 | /** 50 | * Determines whether an array includes a certain element, returning true or false as appropriate. 51 | * @param searchElement The element to search for. 52 | * @param fromIndex The position in this array at which to begin searching for searchElement. 53 | */ 54 | includes(searchElement: number, fromIndex?: number): boolean; 55 | } 56 | 57 | interface Uint8ClampedArray { 58 | /** 59 | * Determines whether an array includes a certain element, returning true or false as appropriate. 60 | * @param searchElement The element to search for. 61 | * @param fromIndex The position in this array at which to begin searching for searchElement. 62 | */ 63 | includes(searchElement: number, fromIndex?: number): boolean; 64 | } 65 | 66 | interface Int16Array { 67 | /** 68 | * Determines whether an array includes a certain element, returning true or false as appropriate. 69 | * @param searchElement The element to search for. 70 | * @param fromIndex The position in this array at which to begin searching for searchElement. 71 | */ 72 | includes(searchElement: number, fromIndex?: number): boolean; 73 | } 74 | 75 | interface Uint16Array { 76 | /** 77 | * Determines whether an array includes a certain element, returning true or false as appropriate. 78 | * @param searchElement The element to search for. 79 | * @param fromIndex The position in this array at which to begin searching for searchElement. 80 | */ 81 | includes(searchElement: number, fromIndex?: number): boolean; 82 | } 83 | 84 | interface Int32Array { 85 | /** 86 | * Determines whether an array includes a certain element, returning true or false as appropriate. 87 | * @param searchElement The element to search for. 88 | * @param fromIndex The position in this array at which to begin searching for searchElement. 89 | */ 90 | includes(searchElement: number, fromIndex?: number): boolean; 91 | } 92 | 93 | interface Uint32Array { 94 | /** 95 | * Determines whether an array includes a certain element, returning true or false as appropriate. 96 | * @param searchElement The element to search for. 97 | * @param fromIndex The position in this array at which to begin searching for searchElement. 98 | */ 99 | includes(searchElement: number, fromIndex?: number): boolean; 100 | } 101 | 102 | interface Float32Array { 103 | /** 104 | * Determines whether an array includes a certain element, returning true or false as appropriate. 105 | * @param searchElement The element to search for. 106 | * @param fromIndex The position in this array at which to begin searching for searchElement. 107 | */ 108 | includes(searchElement: number, fromIndex?: number): boolean; 109 | } 110 | 111 | interface Float64Array { 112 | /** 113 | * Determines whether an array includes a certain element, returning true or false as appropriate. 114 | * @param searchElement The element to search for. 115 | * @param fromIndex The position in this array at which to begin searching for searchElement. 116 | */ 117 | includes(searchElement: number, fromIndex?: number): boolean; 118 | } -------------------------------------------------------------------------------- /official-lib-declarations/CHANGELOG.MD: -------------------------------------------------------------------------------- 1 | # Official TypeScript Lib Declarations Change Logs 2 | 3 | This document will be used to track TypeScript lib changes inbetween versions, for libs relevant to ts-polyfill. 4 | 5 | ### 3.9.3 6 | 7 | https://github.com/microsoft/TypeScript/releases/tag/v3.9.3 8 | 9 | - DOM and DOM iterable have many, many changes 10 | 11 | - ES2015.Core `isFinite` allows passing `unknown` value now 12 | 13 | - Minor fixes to Promise polyfills 14 | 15 | - Symbol Wellknown fixed `Uint8Array` string 16 | 17 | - ES2018.Intl has more fields 18 | 19 | - ES2019 Array has `FlatArray` interface 20 | 21 | - ES2020 BigInt has `valueOf` in Array now 22 | 23 | ### 3.8.3 24 | 25 | https://github.com/microsoft/TypeScript/releases/tag/v3.8.3 26 | 27 | > No changes. 28 | 29 | ### 3.8.2 30 | 31 | https://github.com/microsoft/TypeScript/releases/tag/v3.8.2 32 | 33 | > No changes. 34 | 35 | ### 3.8.1-rc 36 | 37 | https://github.com/microsoft/TypeScript/releases/tag/v3.8-rc 38 | 39 | - Many, many updates to `lib.dom` 40 | 41 | - ES2019.Symbol lib: `Symbol.description` type changed to `string | undefined` 42 | 43 | - New libs added: ES2020.BigInt (not polyfilled) and ES2020.Promise (polyfilled) 44 | 45 | - Added polyfill for wrongly typed ES2015.Core lib method: `Object.isFrozen` in ES5 has different behavior to ES2015+ https://github.com/ryanelian/ts-polyfill/pull/10 46 | 47 | ### 3.7.5 48 | 49 | > No changes. 50 | 51 | ### 3.7.3 52 | 53 | https://github.com/microsoft/TypeScript/releases/tag/v3.7-rc 54 | 55 | - Mostly parameters changes (data types). Minor and does not break existing codes apparently. 56 | 57 | - New `globalThis` special-case polyfill added. 58 | 59 | ### 3.6.3 60 | 61 | https://github.com/microsoft/TypeScript/releases/tag/v3.6.3 62 | 63 | - *No dist binary changes* 64 | 65 | - New lib: Async Generator 66 | 67 | - ES2015 RegExp constructor now accept string. 68 | 69 | - Minor changes in iterator related libs. 70 | 71 | - Fixed comment in ES2019 string lib. 72 | 73 | ### 3.5.3 74 | 75 | https://github.com/microsoft/TypeScript/releases/tag/v3.5.3 76 | 77 | - New lib: ES2019 Object 78 | 79 | ### 3.5.1 / 3.5.0-rc 80 | 81 | https://github.com/microsoft/TypeScript/releases/tag/v3.5.1 82 | 83 | https://devblogs.microsoft.com/typescript/announcing-typescript-3-5-rc/ 84 | 85 | - New libs: ES2020 String, ES2020 Well-Known Symbols 86 | 87 | **Breaking Changes:** 88 | 89 | - Generic type parameters are implicitly constrained to `unknown` 90 | 91 | - lib.d.ts includes the `Omit` helper type 92 | 93 | - `Object.keys` rejects primitives in ES5 94 | 95 | ### 3.4.5 96 | 97 | https://github.com/microsoft/TypeScript/releases/tag/v3.4.5 98 | 99 | - New libs are added: ES2019 Array, String, Symbol 100 | 101 | ### 3.3.3 102 | 103 | https://github.com/Microsoft/TypeScript/releases/tag/v3.3.1 104 | 105 | - No changes in TypeScript declarations. core-js updated with bug fixes. 106 | 107 | > TypeScript tag `3.3.3` is missing from GitHub... 108 | 109 | ### 3.2.2 110 | 111 | https://github.com/Microsoft/TypeScript/releases/tag/v3.2.1 112 | 113 | - No changes in TypeScript declarations. core-js was updated but did not affect bundle. 114 | 115 | ### 3.2.1 116 | 117 | https://github.com/Microsoft/TypeScript/releases/tag/v3.2.1 118 | 119 | - Minor changes in `MapConstructor` interface. Should affect nothing... 120 | 121 | ### 3.1.6 122 | 123 | https://github.com/Microsoft/TypeScript/releases/tag/v3.1.6 124 | 125 | > No changes. Also applies to [3.1.4](https://github.com/Microsoft/TypeScript/releases/tag/v3.1.4) and [3.1.5](https://github.com/Microsoft/TypeScript/releases/tag/v3.1.5). 126 | 127 | ### 3.1.3 128 | 129 | https://github.com/Microsoft/TypeScript/releases/tag/v3.1.3 130 | 131 | > No changes. Also applies to [3.1.2](https://github.com/Microsoft/TypeScript/releases/tag/v3.1.2) 132 | 133 | ### 3.1.1 134 | 135 | https://github.com/Microsoft/TypeScript/releases/tag/v3.1.1 136 | 137 | > Bundled polyfill is identical to the 3.0.3, so no new release / won't publish for now. 138 | 139 | > Minor changes to comments and the `es2017.string` lib regression in 3.0.3 was fixed. 140 | 141 | ### 3.0.3 142 | 143 | https://github.com/Microsoft/TypeScript/releases/tag/v3.0.3 144 | 145 | > No changes, [but suddenly `es2017.string` lib is not valid in `tsconfig.json`](https://github.com/Microsoft/TypeScript/issues/26827). (But no error if lib is included. Builds will fail if using `padStart` or `padEnd` methods but lib is not included!) 146 | 147 | ### 3.0.1 148 | 149 | https://github.com/Microsoft/TypeScript/releases/tag/v3.0.1 150 | 151 | > No changes. 152 | 153 | ### 3.0.0 154 | 155 | https://github.com/Microsoft/TypeScript/releases/tag/v3.0.0 156 | 157 | > No changes, but interesting: the root `lib.d.ts` now references other libs instead of having duped content. 158 | 159 | ### 2.9.2 160 | 161 | https://github.com/Microsoft/TypeScript/releases/tag/v2.9.2 162 | 163 | > No changes. 164 | 165 | ### 2.9.1 166 | 167 | https://github.com/Microsoft/TypeScript/releases/tag/v2.9.1 168 | 169 | > No changes. 170 | 171 | ### 2.9.0 (from 2.8.3) 172 | 173 | https://github.com/Microsoft/TypeScript/releases/tag/v2.9.0 174 | 175 | - [`Object.hasOwnProperty`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty) and [`Object.propertyIsEnumerable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable) are removed from `es2015-core` lib. (Should be compatible with all browsers, not just ES2015+) 176 | 177 | - `Promise.reject` and `Promise.reject` methods are merged to `Promise.reject` 178 | -------------------------------------------------------------------------------- /src/es2016-array-include.ts: -------------------------------------------------------------------------------- 1 | // /*! ***************************************************************************** 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | // MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | // See the Apache Version 2.0 License for specific language governing permissions 13 | // and limitations under the License. 14 | // ***************************************************************************** */ 15 | 16 | 17 | 18 | // /// 19 | 20 | 21 | // interface Array { 22 | // /** 23 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 24 | // * @param searchElement The element to search for. 25 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 26 | // */ 27 | // includes(searchElement: T, fromIndex?: number): boolean; 28 | // } 29 | 30 | // interface ReadonlyArray { 31 | // /** 32 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 33 | // * @param searchElement The element to search for. 34 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 35 | // */ 36 | // includes(searchElement: T, fromIndex?: number): boolean; 37 | // } 38 | 39 | // interface Int8Array { 40 | // /** 41 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 42 | // * @param searchElement The element to search for. 43 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 44 | // */ 45 | // includes(searchElement: number, fromIndex?: number): boolean; 46 | // } 47 | 48 | // interface Uint8Array { 49 | // /** 50 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 51 | // * @param searchElement The element to search for. 52 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 53 | // */ 54 | // includes(searchElement: number, fromIndex?: number): boolean; 55 | // } 56 | 57 | // interface Uint8ClampedArray { 58 | // /** 59 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 60 | // * @param searchElement The element to search for. 61 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 62 | // */ 63 | // includes(searchElement: number, fromIndex?: number): boolean; 64 | // } 65 | 66 | // interface Int16Array { 67 | // /** 68 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 69 | // * @param searchElement The element to search for. 70 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 71 | // */ 72 | // includes(searchElement: number, fromIndex?: number): boolean; 73 | // } 74 | 75 | // interface Uint16Array { 76 | // /** 77 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 78 | // * @param searchElement The element to search for. 79 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 80 | // */ 81 | // includes(searchElement: number, fromIndex?: number): boolean; 82 | // } 83 | 84 | // interface Int32Array { 85 | // /** 86 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 87 | // * @param searchElement The element to search for. 88 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 89 | // */ 90 | // includes(searchElement: number, fromIndex?: number): boolean; 91 | // } 92 | 93 | // interface Uint32Array { 94 | // /** 95 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 96 | // * @param searchElement The element to search for. 97 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 98 | // */ 99 | // includes(searchElement: number, fromIndex?: number): boolean; 100 | // } 101 | 102 | // interface Float32Array { 103 | // /** 104 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 105 | // * @param searchElement The element to search for. 106 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 107 | // */ 108 | // includes(searchElement: number, fromIndex?: number): boolean; 109 | // } 110 | 111 | // interface Float64Array { 112 | // /** 113 | // * Determines whether an array includes a certain element, returning true or false as appropriate. 114 | // * @param searchElement The element to search for. 115 | // * @param fromIndex The position in this array at which to begin searching for searchElement. 116 | // */ 117 | // includes(searchElement: number, fromIndex?: number): boolean; 118 | // } 119 | 120 | import 'core-js/es/array/includes'; 121 | import 'core-js/es/typed-array/includes'; 122 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # TS-Polyfill 2 | 3 | > Runtime polyfills for TypeScript libs, powered by [core-js](https://github.com/zloirock/core-js)! :battery: :nut_and_bolt: 4 | 5 | [![npm](https://img.shields.io/npm/v/ts-polyfill.svg)](https://www.npmjs.com/package/ts-polyfill) [![GitHub Actions](https://github.com/ryanelian/ts-polyfill/workflows/Node%20CI/badge.svg)](https://github.com/ryanelian/ts-polyfill/actions) 6 | 7 | ## Install 8 | 9 | `npm install ts-polyfill` 10 | 11 | ## Getting Started 12 | 13 | - Modify your project `tsconfig.json` to add type definitions required. 14 | 15 | - *(Obviously, you don't need EVERYTHING. Pick the ones you actually need to minimize bandwidth!)* 16 | 17 | - In this example, we are targeting ES2015 so only ES2016 and above polyfills are needed: 18 | 19 | ```json 20 | { 21 | "compilerOptions": { 22 | "target": "ES2015", 23 | "lib": [ 24 | "DOM", 25 | "DOM.Iterable", 26 | "ES2015", 27 | "ES2016.Array.Include", 28 | "ES2017.Object", 29 | "ES2017.String", 30 | "ES2018.AsyncIterable", 31 | "ES2018.Promise", 32 | "ES2019.Array", 33 | "ES2019.Object", 34 | "ES2019.String", 35 | "ES2019.Symbol", 36 | "ES2020.Promise", 37 | "ES2020.String", 38 | "ES2020.Symbol.WellKnown" 39 | ] 40 | } 41 | } 42 | ``` 43 | 44 | > It is 2020 and you should be targeting ES2015. [Internet Explorer 11 and Windows 7 are no longer supported by Microsoft and no longer receive security patches](https://support.microsoft.com/en-us/help/17621/internet-explorer-downloads). 45 | 46 | - Then, in the entry point of your application, import the polyfills. 47 | 48 | - The complete list of available polyfills (including ES2015 polyfills for poor souls targeting ES5) can be found here: https://github.com/ryanelian/ts-polyfill/tree/master/lib 49 | 50 | ```ts 51 | // index.ts 52 | import 'ts-polyfill/lib/es2016-array-include'; 53 | import 'ts-polyfill/lib/es2017-object'; 54 | import 'ts-polyfill/lib/es2017-string'; 55 | import 'ts-polyfill/lib/es2018-async-iterable'; // for-await-of 56 | import 'ts-polyfill/lib/es2018-promise'; 57 | import 'ts-polyfill/lib/es2019-array'; 58 | import 'ts-polyfill/lib/es2019-object'; 59 | import 'ts-polyfill/lib/es2019-string'; 60 | import 'ts-polyfill/lib/es2019-symbol'; 61 | import 'ts-polyfill/lib/es2020-promise'; 62 | import 'ts-polyfill/lib/es2020-string'; 63 | import 'ts-polyfill/lib/es2020-symbol-wellknown'; 64 | 65 | import 'ts-polyfill/lib/es2020-global-this'; // globalThis (no tsconfig.json lib) 66 | ``` 67 | 68 | > Shameless self-promotion: **use [instapack](https://github.com/ryanelian/instapack) for easy, rapid, and painless web app development using TypeScript!** 69 | 70 | ## Alternative Techniques 71 | 72 | - Include everything implicitly: :ok_hand: 73 | 74 | - EXCEPT these non-essential polyfills (for portability): `es2015-iterable, es2015-reflect, es2015-symbol, es2015-symbol-wellknown, es2017-typed-arrays, es2018-async-iterable, es2019-symbol, es2020-symbol-wellknown` 75 | 76 | ```ts 77 | import 'ts-polyfill'; 78 | ``` 79 | 80 | - Include everything (also with exceptions listed above) using a pre-built script: download then include these as `