@typescript-deploys/pr-build 5.2.0-pr-54281-18 → 5.2.0-pr-54282-26

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
  }