TypeScript/src/lib
Orta Therox 07fd7bce64
Intl 2021 Updates (#45647)
* Import of Intl.Locale from #39664

* Handle updating es2020.intl and add es2021 for new DateTimeFormatOptions options - re: #39664

* Extends DateTimeFormatOptions for new Intl APIs - re: #45420

* Handle migrating Intl.NumberFormat.formatToParts to es2018 (keeping esnext.intl around)

* Adds Intl.DisplayNames to es2020 - re: #44022

* Remove attributes added in es2021 from es2020 - re: #42944

* Add a reference to es2021 in the command line parser

* Adds some docs about the lib files

* Baselines

* Allow undefined in Intl inputs to allow for ergonomic usage of exactOptionalPropertyTypes - see #45652

* Adds some tests covering the APIs

* Apply suggestions from code review

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

* Handle PR feedback

* More review improvements

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-09-08 10:43:01 +01:00
..
dom.generated.d.ts Restore HTMLDocument constructable value in DOM (#45554) 2021-08-23 15:56:11 -07:00
dom.iterable.d.ts Change file name 2018-06-04 14:05:56 -07:00
dom.iterable.generated.d.ts Migrate over 4.4 lib dom and webworker (#45324) 2021-08-04 17:14:24 -07:00
es5.d.ts Intl 2021 Updates (#45647) 2021-09-08 10:43:01 +01:00
es5.full.d.ts Add 'lib' reference support 2018-05-04 15:51:13 -07:00
es2015.collection.d.ts array-type: [ default: array, generic: array ] 2019-08-08 21:30:18 +03:00
es2015.core.d.ts Update lib types to mark Annex B as deprecated (#43710) 2021-08-30 10:38:07 -07:00
es2015.d.ts Fix import order (#37510) 2020-03-26 13:55:56 -07:00
es2015.full.d.ts PR Feedback 2018-05-31 09:50:51 -07:00
es2015.generator.d.ts Improve type checking and inference for Generators and Async Generators (#30790) 2019-07-03 21:55:59 -07:00
es2015.iterable.d.ts fix(WeakMapConstructor): readonly iterable items (#43905) 2021-05-20 07:18:58 -07:00
es2015.promise.d.ts Remove optionality for Promise resolve callback (#39817) 2020-09-03 17:21:53 -07:00
es2015.proxy.d.ts fix(lib/es2015): Fix definition of ProxyHandler (#35594) 2021-01-04 12:34:51 -08:00
es2015.reflect.d.ts fix(lib/es2015): Fix types of Reflect methods (#41987) 2021-01-04 09:50:34 +00:00
es2015.symbol.d.ts Move symbol instance type to es5 to follow PropertyKey (#23864) 2018-05-03 10:50:10 -07:00
es2015.symbol.wellknown.d.ts IntelliSense doc string.replace typo (#41385) 2021-05-25 08:05:27 -07:00
es2016.array.include.d.ts Enable jsdoc-format lint rule 2017-04-03 14:39:19 -07:00
es2016.d.ts Add 'lib' reference support 2018-05-04 15:51:13 -07:00
es2016.full.d.ts Add 'lib' reference support 2018-05-04 15:51:13 -07:00
es2017.d.ts Add 'lib' reference support 2018-05-04 15:51:13 -07:00
es2017.full.d.ts Add 'lib' reference support 2018-05-04 15:51:13 -07:00
es2017.intl.d.ts add lib.es2018.intl + fix lib.es2017.intl 2018-04-30 15:17:00 -04:00
es2017.object.d.ts microsoft-typescript/no-double-space 2019-06-14 11:52:48 +03:00
es2017.sharedmemory.d.ts lib: remove length field from SharedArrayBuffer (#40858) 2020-10-06 08:27:56 -07:00
es2017.string.d.ts Enable jsdoc-format lint rule 2017-04-03 14:39:19 -07:00
es2017.typedarrays.d.ts Added empty constructors to TypedArrays from es2017 (#19680) 2017-11-06 13:00:05 -08:00
es2018.asyncgenerator.d.ts Fix incorrect parameter types for AsyncIterator next/return (#33354) 2019-09-17 21:02:12 -07:00
es2018.asynciterable.d.ts Eliminate well known symbols as a concept in the checker and rely on unique symbols (#42543) 2021-02-22 14:43:28 -08:00
es2018.d.ts Fix import order (#37510) 2020-03-26 13:55:56 -07:00
es2018.full.d.ts Add 'lib' reference support 2018-05-04 15:51:13 -07:00
es2018.intl.d.ts Intl 2021 Updates (#45647) 2021-09-08 10:43:01 +01:00
es2018.promise.d.ts Revert 'awaited' type (#37610) 2020-03-25 18:39:45 -07:00
es2018.regexp.d.ts Port changes in #24238 to source file 2018-05-19 11:23:41 -07:00
es2019.array.d.ts Accurate Array.prototype.flat definition (#32131) 2020-04-07 09:16:20 -07:00
es2019.d.ts Add ES2019 Object.fromEntries function (#30934) 2019-04-30 09:49:58 -07:00
es2019.full.d.ts Symbol.prototype.description hit stage 4 2019-01-06 11:42:55 +09:00
es2019.object.d.ts Simplify return type of Object.fromEntries (#37457) 2020-03-18 14:35:19 -07:00
es2019.string.d.ts Update lib types to mark Annex B as deprecated (#43710) 2021-08-30 10:38:07 -07:00
es2019.symbol.d.ts fix(lib/es2019): Symbol.description may be undefined (#36263) 2020-01-24 10:06:04 -08:00
es2020.bigint.d.ts improve jsdoc for array fill methods (#43627) 2021-05-18 17:25:38 -07:00
es2020.d.ts Add lib es2020.sharedmemory (#39541) 2020-09-11 11:34:01 -04:00
es2020.full.d.ts add ES2020 matchAll APIs (#30936) 2019-04-25 14:11:50 -07:00
es2020.intl.d.ts Intl 2021 Updates (#45647) 2021-09-08 10:43:01 +01:00
es2020.promise.d.ts Revert 'awaited' type (#37610) 2020-03-25 18:39:45 -07:00
es2020.sharedmemory.d.ts Add lib es2020.sharedmemory (#39541) 2020-09-11 11:34:01 -04:00
es2020.string.d.ts jsdoc/check-alignment 2019-07-18 15:06:56 +03:00
es2020.symbol.wellknown.d.ts Eliminate well known symbols as a concept in the checker and rely on unique symbols (#42543) 2021-02-22 14:43:28 -08:00
es2021.d.ts Add target: ES2021 (#41239) 2021-03-10 13:31:25 -08:00
es2021.full.d.ts Add target: ES2021 (#41239) 2021-03-10 13:31:25 -08:00
es2021.intl.d.ts Intl 2021 Updates (#45647) 2021-09-08 10:43:01 +01:00
es2021.promise.d.ts Add target: ES2021 (#41239) 2021-03-10 13:31:25 -08:00
es2021.string.d.ts Add target: ES2021 (#41239) 2021-03-10 13:31:25 -08:00
es2021.weakref.d.ts Add target: ES2021 (#41239) 2021-03-10 13:31:25 -08:00
esnext.d.ts Add target: ES2021 (#41239) 2021-03-10 13:31:25 -08:00
esnext.full.d.ts Add 'lib' reference support 2018-05-04 15:51:13 -07:00
esnext.intl.d.ts Intl 2021 Updates (#45647) 2021-09-08 10:43:01 +01:00
header.d.ts add no-default-lib tag to core libraries 2016-01-11 21:34:52 -08:00
libs.json Intl 2021 Updates (#45647) 2021-09-08 10:43:01 +01:00
README.md Intl 2021 Updates (#45647) 2021-09-08 10:43:01 +01:00
scripthost.d.ts Add WSH as an alias for WScript in scripthost.d.ts 2018-05-05 17:03:05 +02:00
webworker.generated.d.ts Migrate over 4.4 lib dom and webworker (#45324) 2021-08-04 17:14:24 -07:00
webworker.importscripts.d.ts Fix lint errors 2017-03-17 13:54:18 -07:00
webworker.iterable.generated.d.ts Migrate over 4.4 lib dom and webworker (#45324) 2021-08-04 17:14:24 -07:00

Read this!

The files within this directory are copied and deployed with TypeScript as the set of APIs available as a part of the JavaScript language.

There are three main domains of APIs in src/lib:

  • ECMAScript language features - e.g. JavaScript APIs like functions on Array etc which are documented in ECMA-262
  • DOM APIs - e.g. APIs which are available in web browsers
  • Intl APIs - e.g. APIs scoped to Intl which are documented in ECMA-402

How do we figure out when to add something?

TypeScript has a rule-of-thumb to only add something when it has got far enough through the standards process that it is more or less confirmed. For JavaScript APIs and language features, that means the proposal is at stage 3 or later.

You can find the source of truth for modern language features and Intl APIs in these completed proposal lists:

For the DOM APIs, which are a bit more free-form, we have asked that APIs are available un-prefixed/flagged in at least 2 browser engines (i.e. not just 2 chromium browsers.)

Generated files

The DOM files ending in .generated.d.ts aren't meant to be edited by hand.

If you need to make changes to such files, make a change to the input files for our library generator.