strict-ts-lib-v5.3 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # strict-ts-lib-v5.3
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ac290c1: Leave `Exclude`, `Extract`, `Omit` and `Pick` with the constraints TypeScript
8
+ declares, and widen `strict-ts-lib-v7.0`'s `typescript` peer range to
9
+ `>=6.0.0 <8.0.0`.
10
+
11
+ Both landed on main in #1672 and #1673 but shipped no release: those changesets
12
+ named the bundle packages (`strict-ts-lib-v7.0` and friends) rather than the
13
+ `-source` harnesses this repository versions. `changeset version` bumped the
14
+ bundle manifests, and `strict-lib:gen:packages` — which runs next and stamps
15
+ each bundle with its harness's version — wrote 0.5.1 straight back over them,
16
+ the harnesses never having been bumped at all. Nothing errored; the version
17
+ simply did not move.
18
+
19
+ All twelve harnesses are named. The `fixed` group in `.changeset/config.json`
20
+ would align the versions from a single name, but a changeset's text reaches
21
+ only the packages it names — the rest get a bare version heading with nothing
22
+ under it. A change to the shared converter affects every series equally, so
23
+ every series' changelog should say so.
24
+
25
+ ### `Exclude` and `Omit`
26
+
27
+ Two of the four utility types had their second argument narrowed here —
28
+ `Exclude<T, U extends T>` and `Omit<T, K extends keyof T>`, against upstream's
29
+ `Exclude<T, U>` and `Omit<T, K extends keyof any>`. `Extract` and `Pick`
30
+ already matched.
31
+
32
+ Narrowing makes a choice on the caller's behalf, and only one of the two
33
+ readings is ever right for a given call. Subtracting keys a type may not have
34
+ is legitimate — upstream's own declarations do it — and under the narrowed
35
+ constraint it is a TS2344 that nothing can fix when the declaration lives
36
+ inside a dependency. Making the choice explicit belongs in the caller's code,
37
+ which is what `eslint-plugin-ts-type-forge`'s
38
+ `prefer-strict-or-relaxed-utility-type` does, pointing at `StrictOmit` /
39
+ `RelaxedOmit` and the rest.
40
+
41
+ Only widens what is accepted, so anything that compiled still does.
42
+
43
+ ### Peer range
44
+
45
+ TypeScript 6.0.3 compiles the v7.0 lib set with `skipLibCheck: false` and no
46
+ errors, and resolves `@typescript/lib-*` by the same package-name lookup
47
+ TypeScript 7 uses, so one bundle serves both compilers. Without the wider
48
+ declaration npm refuses to install it beside TypeScript 6.
49
+
3
50
  ## 0.5.1
4
51
 
5
52
  ### Patch Changes
@@ -33502,10 +33502,7 @@ interface MathMLElementTagNameMap {
33502
33502
  type ElementTagNameMap = HTMLElementTagNameMap &
33503
33503
  Pick<
33504
33504
  SVGElementTagNameMap,
33505
- import('ts-type-forge').RelaxedExclude<
33506
- keyof SVGElementTagNameMap,
33507
- keyof HTMLElementTagNameMap
33508
- >
33505
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
33509
33506
  >;
33510
33507
 
33511
33508
  declare const Audio: {
@@ -46,8 +46,7 @@ declare namespace StrictLibInternals {
46
46
  ToStr<keyof PickByValue<R, R[K]>>,
47
47
  R[K],
48
48
  ];
49
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
50
- }[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
49
+ }[Exclude<keyof R, symbol>]
51
50
  )[]
52
51
  : never;
53
52
  }
@@ -1867,7 +1867,7 @@ type Record<K extends PropertyKey, T> = {
1867
1867
  /**
1868
1868
  * Exclude from T those types that are assignable to U
1869
1869
  */
1870
- type Exclude<T, U extends T> = T extends U ? never : T;
1870
+ type Exclude<T, U> = T extends U ? never : T;
1871
1871
 
1872
1872
  /**
1873
1873
  * Extract from T those types that are assignable to U
@@ -1877,7 +1877,7 @@ type Extract<T, U> = T extends U ? T : never;
1877
1877
  /**
1878
1878
  * Construct a type with the properties of T except for those in type K.
1879
1879
  */
1880
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
1880
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
1881
1881
 
1882
1882
  /**
1883
1883
  * Exclude null and undefined from T
@@ -33509,10 +33509,7 @@ interface MathMLElementTagNameMap {
33509
33509
  type ElementTagNameMap = HTMLElementTagNameMap &
33510
33510
  Pick<
33511
33511
  SVGElementTagNameMap,
33512
- import('ts-type-forge').RelaxedExclude<
33513
- keyof SVGElementTagNameMap,
33514
- keyof HTMLElementTagNameMap
33515
- >
33512
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
33516
33513
  >;
33517
33514
 
33518
33515
  declare const Audio: {
@@ -46,8 +46,7 @@ declare namespace StrictLibInternals {
46
46
  ToStr<keyof PickByValue<R, R[K]>>,
47
47
  R[K],
48
48
  ];
49
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
50
- }[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
49
+ }[Exclude<keyof R, symbol>]
51
50
  )[]
52
51
  : never;
53
52
  }
@@ -2022,7 +2022,7 @@ type Record<K extends PropertyKey, T> = {
2022
2022
  /**
2023
2023
  * Exclude from T those types that are assignable to U
2024
2024
  */
2025
- type Exclude<T, U extends T> = T extends U ? never : T;
2025
+ type Exclude<T, U> = T extends U ? never : T;
2026
2026
 
2027
2027
  /**
2028
2028
  * Extract from T those types that are assignable to U
@@ -2032,7 +2032,7 @@ type Extract<T, U> = T extends U ? T : never;
2032
2032
  /**
2033
2033
  * Construct a type with the properties of T except for those in type K.
2034
2034
  */
2035
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
2035
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
2036
2036
 
2037
2037
  /**
2038
2038
  * Exclude null and undefined from T
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strict-ts-lib-v5.3",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "Strict TypeScript 5.3.3 standard library (all libs in one package)",
6
6
  "license": "Apache-2.0",