typescript 5.2.0-dev.20230608 → 5.2.0-dev.20230610

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.
@@ -60,7 +60,7 @@ interface ReadonlyMap<K, V> {
60
60
  readonly size: number;
61
61
  }
62
62
 
63
- interface WeakMap<K extends object, V> {
63
+ interface WeakMap<K extends WeakKey, V> {
64
64
  /**
65
65
  * Removes the specified element from the WeakMap.
66
66
  * @returns true if the element was successfully removed, or false if it was not present.
@@ -76,14 +76,14 @@ interface WeakMap<K extends object, V> {
76
76
  has(key: K): boolean;
77
77
  /**
78
78
  * Adds a new element with a specified key and value.
79
- * @param key Must be an object.
79
+ * @param key Must be an object or symbol.
80
80
  */
81
81
  set(key: K, value: V): this;
82
82
  }
83
83
 
84
84
  interface WeakMapConstructor {
85
- new <K extends object = object, V = any>(entries?: readonly (readonly [K, V])[] | null): WeakMap<K, V>;
86
- readonly prototype: WeakMap<object, any>;
85
+ new <K extends WeakKey = WeakKey, V = any>(entries?: readonly (readonly [K, V])[] | null): WeakMap<K, V>;
86
+ readonly prototype: WeakMap<WeakKey, any>;
87
87
  }
88
88
  declare var WeakMap: WeakMapConstructor;
89
89
 
@@ -125,9 +125,9 @@ interface ReadonlySet<T> {
125
125
  readonly size: number;
126
126
  }
127
127
 
128
- interface WeakSet<T extends object> {
128
+ interface WeakSet<T extends WeakKey> {
129
129
  /**
130
- * Appends a new object to the end of the WeakSet.
130
+ * Appends a new value to the end of the WeakSet.
131
131
  */
132
132
  add(value: T): this;
133
133
  /**
@@ -136,13 +136,13 @@ interface WeakSet<T extends object> {
136
136
  */
137
137
  delete(value: T): boolean;
138
138
  /**
139
- * @returns a boolean indicating whether an object exists in the WeakSet or not.
139
+ * @returns a boolean indicating whether a value exists in the WeakSet or not.
140
140
  */
141
141
  has(value: T): boolean;
142
142
  }
143
143
 
144
144
  interface WeakSetConstructor {
145
- new <T extends object = object>(values?: readonly T[] | null): WeakSet<T>;
146
- readonly prototype: WeakSet<object>;
145
+ new <T extends WeakKey = WeakKey>(values?: readonly T[] | null): WeakSet<T>;
146
+ readonly prototype: WeakSet<WeakKey>;
147
147
  }
148
148
  declare var WeakSet: WeakSetConstructor;
@@ -159,10 +159,10 @@ interface MapConstructor {
159
159
  new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>;
160
160
  }
161
161
 
162
- interface WeakMap<K extends object, V> { }
162
+ interface WeakMap<K extends WeakKey, V> { }
163
163
 
164
164
  interface WeakMapConstructor {
165
- new <K extends object, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
165
+ new <K extends WeakKey, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
166
166
  }
167
167
 
168
168
  interface Set<T> {
@@ -207,10 +207,10 @@ interface SetConstructor {
207
207
  new <T>(iterable?: Iterable<T> | null): Set<T>;
208
208
  }
209
209
 
210
- interface WeakSet<T extends object> { }
210
+ interface WeakSet<T extends WeakKey> { }
211
211
 
212
212
  interface WeakSetConstructor {
213
- new <T extends object = object>(iterable: Iterable<T>): WeakSet<T>;
213
+ new <T extends WeakKey = WeakKey>(iterable: Iterable<T>): WeakSet<T>;
214
214
  }
215
215
 
216
216
  interface Promise<T> { }
@@ -137,7 +137,7 @@ interface Map<K, V> {
137
137
  readonly [Symbol.toStringTag]: string;
138
138
  }
139
139
 
140
- interface WeakMap<K extends object, V> {
140
+ interface WeakMap<K extends WeakKey, V> {
141
141
  readonly [Symbol.toStringTag]: string;
142
142
  }
143
143
 
@@ -145,7 +145,7 @@ interface Set<T> {
145
145
  readonly [Symbol.toStringTag]: string;
146
146
  }
147
147
 
148
- interface WeakSet<T extends object> {
148
+ interface WeakSet<T extends WeakKey> {
149
149
  readonly [Symbol.toStringTag]: string;
150
150
  }
151
151
 
@@ -16,12 +16,13 @@ and limitations under the License.
16
16
 
17
17
  /// <reference no-default-lib="true"/>
18
18
 
19
- interface WeakRef<T extends object> {
19
+ interface WeakRef<T extends WeakKey> {
20
20
  readonly [Symbol.toStringTag]: "WeakRef";
21
21
 
22
22
  /**
23
- * Returns the WeakRef instance's target object, or undefined if the target object has been
23
+ * Returns the WeakRef instance's target value, or undefined if the target value has been
24
24
  * reclaimed.
25
+ * In es2023 the value can be either a symbol or an object, in previous versions only object is permissible.
25
26
  */
26
27
  deref(): T | undefined;
27
28
  }
@@ -30,10 +31,11 @@ interface WeakRefConstructor {
30
31
  readonly prototype: WeakRef<any>;
31
32
 
32
33
  /**
33
- * Creates a WeakRef instance for the given target object.
34
- * @param target The target object for the WeakRef instance.
34
+ * Creates a WeakRef instance for the given target value.
35
+ * In es2023 the value can be either a symbol or an object, in previous versions only object is permissible.
36
+ * @param target The target value for the WeakRef instance.
35
37
  */
36
- new<T extends object>(target: T): WeakRef<T>;
38
+ new<T extends WeakKey>(target: T): WeakRef<T>;
37
39
  }
38
40
 
39
41
  declare var WeakRef: WeakRefConstructor;
@@ -42,22 +44,23 @@ interface FinalizationRegistry<T> {
42
44
  readonly [Symbol.toStringTag]: "FinalizationRegistry";
43
45
 
44
46
  /**
45
- * Registers an object with the registry.
46
- * @param target The target object to register.
47
- * @param heldValue The value to pass to the finalizer for this object. This cannot be the
48
- * target object.
47
+ * Registers a value with the registry.
48
+ * In es2023 the value can be either a symbol or an object, in previous versions only object is permissible.
49
+ * @param target The target value to register.
50
+ * @param heldValue The value to pass to the finalizer for this value. This cannot be the
51
+ * target value.
49
52
  * @param unregisterToken The token to pass to the unregister method to unregister the target
50
- * object. If provided (and not undefined), this must be an object. If not provided, the target
51
- * cannot be unregistered.
53
+ * value. If not provided, the target cannot be unregistered.
52
54
  */
53
- register(target: object, heldValue: T, unregisterToken?: object): void;
55
+ register(target: WeakKey, heldValue: T, unregisterToken?: WeakKey): void;
54
56
 
55
57
  /**
56
- * Unregisters an object from the registry.
58
+ * Unregisters a value from the registry.
59
+ * In es2023 the value can be either a symbol or an object, in previous versions only object is permissible.
57
60
  * @param unregisterToken The token that was used as the unregisterToken argument when calling
58
- * register to register the target object.
61
+ * register to register the target value.
59
62
  */
60
- unregister(unregisterToken: object): void;
63
+ unregister(unregisterToken: WeakKey): void;
61
64
  }
62
65
 
63
66
  interface FinalizationRegistryConstructor {
@@ -65,7 +68,7 @@ interface FinalizationRegistryConstructor {
65
68
 
66
69
  /**
67
70
  * Creates a finalization registry with an associated cleanup callback
68
- * @param cleanupCallback The callback to call after an object in the registry has been reclaimed.
71
+ * @param cleanupCallback The callback to call after a value in the registry has been reclaimed.
69
72
  */
70
73
  new<T>(cleanupCallback: (heldValue: T) => void): FinalizationRegistry<T>;
71
74
  }
@@ -0,0 +1,21 @@
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
+ /// <reference no-default-lib="true"/>
18
+
19
+ interface WeakKeyTypes {
20
+ symbol: symbol;
21
+ }
@@ -18,3 +18,4 @@ and limitations under the License.
18
18
 
19
19
  /// <reference lib="es2022" />
20
20
  /// <reference lib="es2023.array" />
21
+ /// <reference lib="es2023.collection" />
package/lib/lib.es5.d.ts CHANGED
@@ -1665,6 +1665,15 @@ type Uncapitalize<S extends string> = intrinsic;
1665
1665
  */
1666
1666
  interface ThisType<T> { }
1667
1667
 
1668
+ /**
1669
+ * Stores types to be used with WeakSet, WeakMap, WeakRef, and FinalizationRegistry
1670
+ */
1671
+ interface WeakKeyTypes {
1672
+ object: object;
1673
+ }
1674
+
1675
+ type WeakKey = WeakKeyTypes[keyof WeakKeyTypes];
1676
+
1668
1677
  /**
1669
1678
  * Represents a raw buffer of binary data, which is used to store data for the
1670
1679
  * different typed arrays. ArrayBuffers cannot be read from or written to directly,
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.2";
21
- var version = `${versionMajorMinor}.0-dev.20230608`;
21
+ var version = `${versionMajorMinor}.0-dev.20230610`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -33428,7 +33428,9 @@ var libEntries = [
33428
33428
  ["es2022.string", "lib.es2022.string.d.ts"],
33429
33429
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
33430
33430
  ["es2023.array", "lib.es2023.array.d.ts"],
33431
+ ["es2023.collection", "lib.es2023.collection.d.ts"],
33431
33432
  ["esnext.array", "lib.es2023.array.d.ts"],
33433
+ ["esnext.collection", "lib.es2023.collection.d.ts"],
33432
33434
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
33433
33435
  ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
33434
33436
  ["esnext.intl", "lib.esnext.intl.d.ts"],
package/lib/tsserver.js CHANGED
@@ -2305,7 +2305,7 @@ module.exports = __toCommonJS(server_exports);
2305
2305
 
2306
2306
  // src/compiler/corePublic.ts
2307
2307
  var versionMajorMinor = "5.2";
2308
- var version = `${versionMajorMinor}.0-dev.20230608`;
2308
+ var version = `${versionMajorMinor}.0-dev.20230610`;
2309
2309
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2310
2310
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2311
2311
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -37803,7 +37803,9 @@ var libEntries = [
37803
37803
  ["es2022.string", "lib.es2022.string.d.ts"],
37804
37804
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
37805
37805
  ["es2023.array", "lib.es2023.array.d.ts"],
37806
+ ["es2023.collection", "lib.es2023.collection.d.ts"],
37806
37807
  ["esnext.array", "lib.es2023.array.d.ts"],
37808
+ ["esnext.collection", "lib.es2023.collection.d.ts"],
37807
37809
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
37808
37810
  ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
37809
37811
  ["esnext.intl", "lib.esnext.intl.d.ts"],
@@ -161335,7 +161337,10 @@ var Core;
161335
161337
  }
161336
161338
  Core2.someSignatureUsage = someSignatureUsage;
161337
161339
  function getPossibleSymbolReferenceNodes(sourceFile, symbolName2, container = sourceFile) {
161338
- return getPossibleSymbolReferencePositions(sourceFile, symbolName2, container).map((pos) => getTouchingPropertyName(sourceFile, pos));
161340
+ return mapDefined(getPossibleSymbolReferencePositions(sourceFile, symbolName2, container), (pos) => {
161341
+ const referenceLocation = getTouchingPropertyName(sourceFile, pos);
161342
+ return referenceLocation === sourceFile ? void 0 : referenceLocation;
161343
+ });
161339
161344
  }
161340
161345
  function getPossibleSymbolReferencePositions(sourceFile, symbolName2, container = sourceFile) {
161341
161346
  const positions = [];
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230608`;
38
+ version = `${versionMajorMinor}.0-dev.20230610`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -37307,7 +37307,9 @@ ${lanes.join("\n")}
37307
37307
  ["es2022.string", "lib.es2022.string.d.ts"],
37308
37308
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
37309
37309
  ["es2023.array", "lib.es2023.array.d.ts"],
37310
+ ["es2023.collection", "lib.es2023.collection.d.ts"],
37310
37311
  ["esnext.array", "lib.es2023.array.d.ts"],
37312
+ ["esnext.collection", "lib.es2023.collection.d.ts"],
37311
37313
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
37312
37314
  ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
37313
37315
  ["esnext.intl", "lib.esnext.intl.d.ts"],
@@ -160645,7 +160647,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160645
160647
  }
160646
160648
  Core2.someSignatureUsage = someSignatureUsage;
160647
160649
  function getPossibleSymbolReferenceNodes(sourceFile, symbolName2, container = sourceFile) {
160648
- return getPossibleSymbolReferencePositions(sourceFile, symbolName2, container).map((pos) => getTouchingPropertyName(sourceFile, pos));
160650
+ return mapDefined(getPossibleSymbolReferencePositions(sourceFile, symbolName2, container), (pos) => {
160651
+ const referenceLocation = getTouchingPropertyName(sourceFile, pos);
160652
+ return referenceLocation === sourceFile ? void 0 : referenceLocation;
160653
+ });
160649
160654
  }
160650
160655
  function getPossibleSymbolReferencePositions(sourceFile, symbolName2, container = sourceFile) {
160651
160656
  const positions = [];
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230608`;
38
+ version = `${versionMajorMinor}.0-dev.20230610`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -37307,7 +37307,9 @@ ${lanes.join("\n")}
37307
37307
  ["es2022.string", "lib.es2022.string.d.ts"],
37308
37308
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
37309
37309
  ["es2023.array", "lib.es2023.array.d.ts"],
37310
+ ["es2023.collection", "lib.es2023.collection.d.ts"],
37310
37311
  ["esnext.array", "lib.es2023.array.d.ts"],
37312
+ ["esnext.collection", "lib.es2023.collection.d.ts"],
37311
37313
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
37312
37314
  ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
37313
37315
  ["esnext.intl", "lib.esnext.intl.d.ts"],
@@ -160660,7 +160662,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160660
160662
  }
160661
160663
  Core2.someSignatureUsage = someSignatureUsage;
160662
160664
  function getPossibleSymbolReferenceNodes(sourceFile, symbolName2, container = sourceFile) {
160663
- return getPossibleSymbolReferencePositions(sourceFile, symbolName2, container).map((pos) => getTouchingPropertyName(sourceFile, pos));
160665
+ return mapDefined(getPossibleSymbolReferencePositions(sourceFile, symbolName2, container), (pos) => {
160666
+ const referenceLocation = getTouchingPropertyName(sourceFile, pos);
160667
+ return referenceLocation === sourceFile ? void 0 : referenceLocation;
160668
+ });
160664
160669
  }
160665
160670
  function getPossibleSymbolReferencePositions(sourceFile, symbolName2, container = sourceFile) {
160666
160671
  const positions = [];
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-dev.20230608`;
57
+ var version = `${versionMajorMinor}.0-dev.20230610`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -25432,7 +25432,9 @@ var libEntries = [
25432
25432
  ["es2022.string", "lib.es2022.string.d.ts"],
25433
25433
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
25434
25434
  ["es2023.array", "lib.es2023.array.d.ts"],
25435
+ ["es2023.collection", "lib.es2023.collection.d.ts"],
25435
25436
  ["esnext.array", "lib.es2023.array.d.ts"],
25437
+ ["esnext.collection", "lib.es2023.collection.d.ts"],
25436
25438
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
25437
25439
  ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
25438
25440
  ["esnext.intl", "lib.esnext.intl.d.ts"],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.2.0-dev.20230608",
5
+ "version": "5.2.0-dev.20230610",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "50df25733f3ad42f20a720e8283f1af5d8573510"
117
+ "gitHead": "33eac2825ac548cf804e3d3abbc6a53b320a1de2"
118
118
  }