strict-ts-lib-v6.0 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-v6.0
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
@@ -50116,10 +50116,7 @@ interface MathMLElementTagNameMap {
50116
50116
  type ElementTagNameMap = HTMLElementTagNameMap &
50117
50117
  Pick<
50118
50118
  SVGElementTagNameMap,
50119
- import('ts-type-forge').RelaxedExclude<
50120
- keyof SVGElementTagNameMap,
50121
- keyof HTMLElementTagNameMap
50122
- >
50119
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
50123
50120
  >;
50124
50121
 
50125
50122
  declare const Audio: {
@@ -44,8 +44,7 @@ declare namespace StrictLibInternals {
44
44
  ToStr<keyof PickByValue<R, R[K]>>,
45
45
  R[K],
46
46
  ];
47
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
48
- }[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
47
+ }[Exclude<keyof R, symbol>]
49
48
  )[]
50
49
  : never;
51
50
  }
@@ -1873,7 +1873,7 @@ type Record<K extends PropertyKey, T> = {
1873
1873
  /**
1874
1874
  * Exclude from T those types that are assignable to U
1875
1875
  */
1876
- type Exclude<T, U extends T> = T extends U ? never : T;
1876
+ type Exclude<T, U> = T extends U ? never : T;
1877
1877
 
1878
1878
  /**
1879
1879
  * Extract from T those types that are assignable to U
@@ -1883,7 +1883,7 @@ type Extract<T, U> = T extends U ? T : never;
1883
1883
  /**
1884
1884
  * Construct a type with the properties of T except for those in type K.
1885
1885
  */
1886
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
1886
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
1887
1887
 
1888
1888
  /**
1889
1889
  * Exclude null and undefined from T
@@ -36,12 +36,9 @@ declare namespace Temporal {
36
36
  type ZonedDateTimeLike = ZonedDateTime | ZonedDateTimeLikeObject | string;
37
37
 
38
38
  type PartialTemporalLike<T extends object> = {
39
- readonly [
40
- P in import('ts-type-forge').RelaxedExclude<
41
- keyof T,
42
- 'calendar' | 'timeZone'
43
- >
44
- ]?: T[P] | undefined;
39
+ readonly [P in Exclude<keyof T, 'calendar' | 'timeZone'>]?:
40
+ | T[P]
41
+ | undefined;
45
42
  };
46
43
 
47
44
  interface DateLikeObject {
@@ -50123,10 +50123,7 @@ interface MathMLElementTagNameMap {
50123
50123
  type ElementTagNameMap = HTMLElementTagNameMap &
50124
50124
  Pick<
50125
50125
  SVGElementTagNameMap,
50126
- import('ts-type-forge').RelaxedExclude<
50127
- keyof SVGElementTagNameMap,
50128
- keyof HTMLElementTagNameMap
50129
- >
50126
+ Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
50130
50127
  >;
50131
50128
 
50132
50129
  declare const Audio: {
@@ -44,8 +44,7 @@ declare namespace StrictLibInternals {
44
44
  ToStr<keyof PickByValue<R, R[K]>>,
45
45
  R[K],
46
46
  ];
47
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
48
- }[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
47
+ }[Exclude<keyof R, symbol>]
49
48
  )[]
50
49
  : never;
51
50
  }
@@ -2028,7 +2028,7 @@ type Record<K extends PropertyKey, T> = {
2028
2028
  /**
2029
2029
  * Exclude from T those types that are assignable to U
2030
2030
  */
2031
- type Exclude<T, U extends T> = T extends U ? never : T;
2031
+ type Exclude<T, U> = T extends U ? never : T;
2032
2032
 
2033
2033
  /**
2034
2034
  * Extract from T those types that are assignable to U
@@ -2038,7 +2038,7 @@ type Extract<T, U> = T extends U ? T : never;
2038
2038
  /**
2039
2039
  * Construct a type with the properties of T except for those in type K.
2040
2040
  */
2041
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
2041
+ type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
2042
2042
 
2043
2043
  /**
2044
2044
  * Exclude null and undefined from T
@@ -36,12 +36,9 @@ declare namespace Temporal {
36
36
  type ZonedDateTimeLike = ZonedDateTime | ZonedDateTimeLikeObject | string;
37
37
 
38
38
  type PartialTemporalLike<T extends object> = {
39
- readonly [
40
- P in import('ts-type-forge').RelaxedExclude<
41
- keyof T,
42
- 'calendar' | 'timeZone'
43
- >
44
- ]?: T[P] | undefined;
39
+ readonly [P in Exclude<keyof T, 'calendar' | 'timeZone'>]?:
40
+ | T[P]
41
+ | undefined;
45
42
  };
46
43
 
47
44
  interface DateLikeObject {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strict-ts-lib-v6.0",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "Strict TypeScript 6.0.3 standard library (all libs in one package)",
6
6
  "license": "Apache-2.0",