Files
TypeScript/src/lib
Anders Hejlsberg 51b346d65a Improve intersection reduction and CFA for truthy, equality, and typeof checks (#49119)
* Improve reduction of intersection types

* Accept new baselines

* Improve CFA for truthy, equality, and typeof checks

* Accept new baselines

* Remove special case for Function type

* Don't reduce intersections of form {...} & object

* Accept new baselines

* Anything is assignable to unknown-like union

* Accept new baselines

* Tweak subtype check

* Recombine unknown type from unknown-like union in more cases

* Display union origin only if it is shorter than union itself

* Accept new baselines

* Add tests

* Only attach origin type when it is shorter than union itself

* Specially preserve string & {}, number & {}, bigint & {}

* Accept new baselines

* Add additional tests

* Fix getNormalizedType and getNarrowableTypeForReference for intersections

* Switch NonNullable<T> to use T & {}

* Accept new baselines

* Use NonNullable<T> in place of anonymous T & {}

* Accept new baselines

* Add fourslash test

* More fourslash tests

* Fix getFalsyFlags handling of intersections

* Accept new baselines

* Add constraint to compareProperties type parameter

* Unconstrained type parameter not assignable to {} with strictNullChecks

* Accept new baselines
2022-05-27 14:02:54 -07:00
..
2018-06-04 14:05:56 -07:00
2018-05-04 15:51:13 -07:00
2020-03-26 13:55:56 -07:00
2018-05-31 09:50:51 -07:00
2018-05-04 15:51:13 -07:00
2018-05-04 15:51:13 -07:00
2018-05-04 15:51:13 -07:00
2018-05-04 15:51:13 -07:00
2020-03-26 13:55:56 -07:00
2018-05-04 15:51:13 -07:00
2019-07-18 15:06:56 +03:00
2021-03-10 13:31:25 -08:00
2021-03-10 13:31:25 -08:00
2021-11-04 10:55:11 -07:00
2021-11-04 10:55:11 -07:00
2018-05-04 15:51:13 -07:00
2021-09-08 10:43:01 +01:00
2017-03-17 13:54:18 -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.