Skip to content

Commit c93ba41

Browse files
authoredDec 30, 2021
typings: add types for symbol and accessor properties on primordials
PR-URL: nodejs#40992 Reviewed-By: James M Snell <[email protected]>
1 parent a100a93 commit c93ba41

File tree

1 file changed

+117
-52
lines changed

1 file changed

+117
-52
lines changed
 

‎typings/primordials.d.ts

+117-52
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
import { AsyncIterator } from "internal/webstreams/util";
2-
31
type UncurryThis<T extends (this: unknown, ...args: unknown[]) => unknown> =
42
(self: ThisParameterType<T>, ...args: Parameters<T>) => ReturnType<T>;
53
type UncurryThisStaticApply<T extends (this: unknown, ...args: unknown[]) => unknown> =
64
(self: ThisParameterType<T>, args: Parameters<T>) => ReturnType<T>;
75
type StaticApply<T extends (this: unknown, ...args: unknown[]) => unknown> =
86
(args: Parameters<T>) => ReturnType<T>;
97

8+
type UncurryMethod<O, K extends keyof O, T = O> =
9+
O[K] extends (this: infer U, ...args: infer A) => infer R
10+
? (self: unknown extends U ? T : U, ...args: A) => R
11+
: never;
12+
type UncurryMethodApply<O, K extends keyof O, T = O> =
13+
O[K] extends (this: infer U, ...args: infer A) => infer R
14+
? (self: unknown extends U ? T : U, args: A) => R
15+
: never;
16+
17+
type UncurryGetter<O, K extends keyof O, T = O> =
18+
O[K] extends infer V ? (self: T) => V : never;
19+
type UncurrySetter<O, K extends keyof O, T = O> =
20+
O[K] extends infer V ? (self: T, value: V) => void : never;
21+
22+
type TypedArrayContentType<T extends TypedArray> = T extends { [k: number]: infer V } ? V : never;
23+
1024
/**
1125
* Primordials are a way to safely use globals without fear of global mutation
1226
* Generally, this means removing `this` parameter usage and instead using
@@ -24,17 +38,14 @@ type StaticApply<T extends (this: unknown, ...args: unknown[]) => unknown> =
2438
* primordials.StringPrototypeStartsWith('thing', 'hello')
2539
* ```
2640
*/
27-
declare namespace Primordials {
28-
export function uncurryThis<
29-
T extends (...args: unknown[]) => unknown
30-
> (fn: T):
31-
(self: ThisType<T>, ...args: Parameters<T>) => ReturnType<T>;
41+
declare namespace primordials {
42+
export function uncurryThis<T extends (...args: unknown[]) => unknown>(fn: T): UncurryThis<T>;
3243
export function makeSafe<T extends NewableFunction>(unsafe: NewableFunction, safe: T): T;
3344

34-
export const decodeURI: typeof globalThis.decodeURI;
35-
export const decodeURIComponent: typeof globalThis.decodeURIComponent;
36-
export const encodeURI: typeof globalThis.encodeURI;
37-
export const encodeURIComponent: typeof globalThis.encodeURIComponent;
45+
export import decodeURI = globalThis.decodeURI;
46+
export import decodeURIComponent = globalThis.decodeURIComponent;
47+
export import encodeURI = globalThis.encodeURI;
48+
export import encodeURIComponent = globalThis.encodeURIComponent;
3849
export const JSONParse: typeof JSON.parse
3950
export const JSONStringify: typeof JSON.stringify
4051
export const MathAbs: typeof Math.abs
@@ -94,11 +105,11 @@ declare namespace Primordials {
94105
export const ReflectPreventExtensions: typeof Reflect.preventExtensions
95106
export const ReflectSet: typeof Reflect.set
96107
export const ReflectSetPrototypeOf: typeof Reflect.setPrototypeOf
97-
export const AggregateError: typeof globalThis.AggregateError;
108+
export import AggregateError = globalThis.AggregateError;
98109
export const AggregateErrorLength: typeof AggregateError.length
99110
export const AggregateErrorName: typeof AggregateError.name
100111
export const AggregateErrorPrototype: typeof AggregateError.prototype
101-
export const Array: typeof globalThis.Array;
112+
export import Array = globalThis.Array;
102113
export const ArrayLength: typeof Array.length
103114
export const ArrayName: typeof Array.name
104115
export const ArrayPrototype: typeof Array.prototype
@@ -138,14 +149,15 @@ declare namespace Primordials {
138149
export const ArrayPrototypeReduceRight: UncurryThis<typeof Array.prototype.reduceRight>
139150
export const ArrayPrototypeToLocaleString: UncurryThis<typeof Array.prototype.toLocaleString>
140151
export const ArrayPrototypeToString: UncurryThis<typeof Array.prototype.toString>
141-
export const ArrayBuffer: typeof globalThis.ArrayBuffer;
152+
export const ArrayPrototypeSymbolIterator: UncurryMethod<typeof Array.prototype, typeof Symbol.iterator>;
153+
export import ArrayBuffer = globalThis.ArrayBuffer;
142154
export const ArrayBufferLength: typeof ArrayBuffer.length
143155
export const ArrayBufferName: typeof ArrayBuffer.name
144156
export const ArrayBufferPrototype: typeof ArrayBuffer.prototype
145157
export const ArrayBufferIsView: typeof ArrayBuffer.isView
146158
export const ArrayBufferPrototypeSlice: UncurryThis<typeof ArrayBuffer.prototype.slice>
147-
export const AsyncIteratorPrototype: UncurryThis<typeof AsyncIterator>
148-
export const BigInt: typeof globalThis.BigInt;
159+
export const AsyncIteratorPrototype: AsyncIterable<any>;
160+
export import BigInt = globalThis.BigInt;
149161
export const BigIntLength: typeof BigInt.length
150162
export const BigIntName: typeof BigInt.name
151163
export const BigIntPrototype: typeof BigInt.prototype
@@ -154,23 +166,23 @@ declare namespace Primordials {
154166
export const BigIntPrototypeToLocaleString: UncurryThis<typeof BigInt.prototype.toLocaleString>
155167
export const BigIntPrototypeToString: UncurryThis<typeof BigInt.prototype.toString>
156168
export const BigIntPrototypeValueOf: UncurryThis<typeof BigInt.prototype.valueOf>
157-
export const BigInt64Array: typeof globalThis.BigInt64Array;
169+
export import BigInt64Array = globalThis.BigInt64Array;
158170
export const BigInt64ArrayLength: typeof BigInt64Array.length
159171
export const BigInt64ArrayName: typeof BigInt64Array.name
160172
export const BigInt64ArrayPrototype: typeof BigInt64Array.prototype
161173
export const BigInt64ArrayBYTES_PER_ELEMENT: typeof BigInt64Array.BYTES_PER_ELEMENT
162-
export const BigUint64Array: typeof globalThis.BigUint64Array;
174+
export import BigUint64Array = globalThis.BigUint64Array;
163175
export const BigUint64ArrayLength: typeof BigUint64Array.length
164176
export const BigUint64ArrayName: typeof BigUint64Array.name
165177
export const BigUint64ArrayPrototype: typeof BigUint64Array.prototype
166178
export const BigUint64ArrayBYTES_PER_ELEMENT: typeof BigUint64Array.BYTES_PER_ELEMENT
167-
export const Boolean: typeof globalThis.Boolean;
179+
export import Boolean = globalThis.Boolean;
168180
export const BooleanLength: typeof Boolean.length
169181
export const BooleanName: typeof Boolean.name
170182
export const BooleanPrototype: typeof Boolean.prototype
171183
export const BooleanPrototypeToString: UncurryThis<typeof Boolean.prototype.toString>
172184
export const BooleanPrototypeValueOf: UncurryThis<typeof Boolean.prototype.valueOf>
173-
export const DataView: typeof globalThis.DataView;
185+
export import DataView = globalThis.DataView;
174186
export const DataViewLength: typeof DataView.length
175187
export const DataViewName: typeof DataView.name
176188
export const DataViewPrototype: typeof DataView.prototype
@@ -194,7 +206,10 @@ declare namespace Primordials {
194206
export const DataViewPrototypeSetBigInt64: UncurryThis<typeof DataView.prototype.setBigInt64>
195207
export const DataViewPrototypeGetBigUint64: UncurryThis<typeof DataView.prototype.getBigUint64>
196208
export const DataViewPrototypeSetBigUint64: UncurryThis<typeof DataView.prototype.setBigUint64>
197-
export const Date: typeof globalThis.Date;
209+
export const DataViewPrototypeGetBuffer: UncurryGetter<typeof DataView.prototype, "buffer">;
210+
export const DataViewPrototypeGetByteLength: UncurryGetter<typeof DataView.prototype, "byteLength">;
211+
export const DataViewPrototypeGetByteOffset: UncurryGetter<typeof DataView.prototype, "byteOffset">;
212+
export import Date = globalThis.Date;
198213
export const DateLength: typeof Date.length
199214
export const DateName: typeof Date.name
200215
export const DatePrototype: typeof Date.prototype
@@ -247,51 +262,52 @@ declare namespace Primordials {
247262
export const DatePrototypeToLocaleString: UncurryThis<typeof Date.prototype.toLocaleString>
248263
export const DatePrototypeToLocaleDateString: UncurryThis<typeof Date.prototype.toLocaleDateString>
249264
export const DatePrototypeToLocaleTimeString: UncurryThis<typeof Date.prototype.toLocaleTimeString>
250-
export const Error: typeof globalThis.Error;
265+
export const DatePrototypeSymbolToPrimitive: UncurryMethod<typeof Date.prototype, typeof Symbol.toPrimitive>;
266+
export import Error = globalThis.Error;
251267
export const ErrorLength: typeof Error.length
252268
export const ErrorName: typeof Error.name
253269
export const ErrorPrototype: typeof Error.prototype
254270
export const ErrorCaptureStackTrace: typeof Error.captureStackTrace
255271
export const ErrorStackTraceLimit: typeof Error.stackTraceLimit
256272
export const ErrorPrototypeToString: UncurryThis<typeof Error.prototype.toString>
257-
export const EvalError: typeof globalThis.EvalError;
273+
export import EvalError = globalThis.EvalError;
258274
export const EvalErrorLength: typeof EvalError.length
259275
export const EvalErrorName: typeof EvalError.name
260276
export const EvalErrorPrototype: typeof EvalError.prototype
261-
export const Float32Array: typeof globalThis.Float32Array;
277+
export import Float32Array = globalThis.Float32Array;
262278
export const Float32ArrayLength: typeof Float32Array.length
263279
export const Float32ArrayName: typeof Float32Array.name
264280
export const Float32ArrayPrototype: typeof Float32Array.prototype
265281
export const Float32ArrayBYTES_PER_ELEMENT: typeof Float32Array.BYTES_PER_ELEMENT
266-
export const Float64Array: typeof globalThis.Float64Array;
282+
export import Float64Array = globalThis.Float64Array;
267283
export const Float64ArrayLength: typeof Float64Array.length
268284
export const Float64ArrayName: typeof Float64Array.name
269285
export const Float64ArrayPrototype: typeof Float64Array.prototype
270286
export const Float64ArrayBYTES_PER_ELEMENT: typeof Float64Array.BYTES_PER_ELEMENT
271-
export const Function: typeof globalThis.Function;
287+
export import Function = globalThis.Function;
272288
export const FunctionLength: typeof Function.length
273289
export const FunctionName: typeof Function.name
274290
export const FunctionPrototype: typeof Function.prototype
275291
export const FunctionPrototypeApply: UncurryThis<typeof Function.prototype.apply>
276292
export const FunctionPrototypeBind: UncurryThis<typeof Function.prototype.bind>
277293
export const FunctionPrototypeCall: UncurryThis<typeof Function.prototype.call>
278294
export const FunctionPrototypeToString: UncurryThis<typeof Function.prototype.toString>
279-
export const Int16Array: typeof globalThis.Int16Array;
295+
export import Int16Array = globalThis.Int16Array;
280296
export const Int16ArrayLength: typeof Int16Array.length
281297
export const Int16ArrayName: typeof Int16Array.name
282298
export const Int16ArrayPrototype: typeof Int16Array.prototype
283299
export const Int16ArrayBYTES_PER_ELEMENT: typeof Int16Array.BYTES_PER_ELEMENT
284-
export const Int32Array: typeof globalThis.Int32Array;
300+
export import Int32Array = globalThis.Int32Array;
285301
export const Int32ArrayLength: typeof Int32Array.length
286302
export const Int32ArrayName: typeof Int32Array.name
287303
export const Int32ArrayPrototype: typeof Int32Array.prototype
288304
export const Int32ArrayBYTES_PER_ELEMENT: typeof Int32Array.BYTES_PER_ELEMENT
289-
export const Int8Array: typeof globalThis.Int8Array;
305+
export import Int8Array = globalThis.Int8Array;
290306
export const Int8ArrayLength: typeof Int8Array.length
291307
export const Int8ArrayName: typeof Int8Array.name
292308
export const Int8ArrayPrototype: typeof Int8Array.prototype
293309
export const Int8ArrayBYTES_PER_ELEMENT: typeof Int8Array.BYTES_PER_ELEMENT
294-
export const Map: typeof globalThis.Map;
310+
export import Map = globalThis.Map;
295311
export const MapLength: typeof Map.length
296312
export const MapName: typeof Map.name
297313
export const MapPrototype: typeof Map.prototype
@@ -304,7 +320,8 @@ declare namespace Primordials {
304320
export const MapPrototypeForEach: UncurryThis<typeof Map.prototype.forEach>
305321
export const MapPrototypeKeys: UncurryThis<typeof Map.prototype.keys>
306322
export const MapPrototypeValues: UncurryThis<typeof Map.prototype.values>
307-
export const Number: typeof globalThis.Number;
323+
export const MapPrototypeGetSize: UncurryGetter<typeof Map.prototype, "size">;
324+
export import Number = globalThis.Number;
308325
export const NumberLength: typeof Number.length
309326
export const NumberName: typeof Number.name
310327
export const NumberPrototype: typeof Number.prototype
@@ -328,7 +345,7 @@ declare namespace Primordials {
328345
export const NumberPrototypeToString: UncurryThis<typeof Number.prototype.toString>
329346
export const NumberPrototypeValueOf: UncurryThis<typeof Number.prototype.valueOf>
330347
export const NumberPrototypeToLocaleString: UncurryThis<typeof Number.prototype.toLocaleString>
331-
export const Object: typeof globalThis.Object;
348+
export import Object = globalThis.Object;
332349
export const ObjectLength: typeof Object.length
333350
export const ObjectName: typeof Object.name
334351
export const ObjectPrototype: typeof Object.prototype
@@ -363,23 +380,31 @@ declare namespace Primordials {
363380
export const ObjectPrototypeToString: UncurryThis<typeof Object.prototype.toString>
364381
export const ObjectPrototypeValueOf: UncurryThis<typeof Object.prototype.valueOf>
365382
export const ObjectPrototypeToLocaleString: UncurryThis<typeof Object.prototype.toLocaleString>
366-
export const RangeError: typeof globalThis.RangeError;
383+
export import RangeError = globalThis.RangeError;
367384
export const RangeErrorLength: typeof RangeError.length
368385
export const RangeErrorName: typeof RangeError.name
369386
export const RangeErrorPrototype: typeof RangeError.prototype
370-
export const ReferenceError: typeof globalThis.ReferenceError;
387+
export import ReferenceError = globalThis.ReferenceError;
371388
export const ReferenceErrorLength: typeof ReferenceError.length
372389
export const ReferenceErrorName: typeof ReferenceError.name
373390
export const ReferenceErrorPrototype: typeof ReferenceError.prototype
374-
export const RegExp: typeof globalThis.RegExp;
391+
export import RegExp = globalThis.RegExp;
375392
export const RegExpLength: typeof RegExp.length
376393
export const RegExpName: typeof RegExp.name
377394
export const RegExpPrototype: typeof RegExp.prototype
378395
export const RegExpPrototypeExec: UncurryThis<typeof RegExp.prototype.exec>
379396
export const RegExpPrototypeCompile: UncurryThis<typeof RegExp.prototype.compile>
380397
export const RegExpPrototypeToString: UncurryThis<typeof RegExp.prototype.toString>
381398
export const RegExpPrototypeTest: UncurryThis<typeof RegExp.prototype.test>
382-
export const Set: typeof globalThis.Set;
399+
export const RegExpPrototypeGetDotAll: UncurryGetter<typeof RegExp.prototype, "dotAll">;
400+
export const RegExpPrototypeGetFlags: UncurryGetter<typeof RegExp.prototype, "flags">;
401+
export const RegExpPrototypeGetGlobal: UncurryGetter<typeof RegExp.prototype, "global">;
402+
export const RegExpPrototypeGetIgnoreCase: UncurryGetter<typeof RegExp.prototype, "ignoreCase">;
403+
export const RegExpPrototypeGetMultiline: UncurryGetter<typeof RegExp.prototype, "multiline">;
404+
export const RegExpPrototypeGetSource: UncurryGetter<typeof RegExp.prototype, "source">;
405+
export const RegExpPrototypeGetSticky: UncurryGetter<typeof RegExp.prototype, "sticky">;
406+
export const RegExpPrototypeGetUnicode: UncurryGetter<typeof RegExp.prototype, "unicode">;
407+
export import Set = globalThis.Set;
383408
export const SetLength: typeof Set.length
384409
export const SetName: typeof Set.name
385410
export const SetPrototype: typeof Set.prototype
@@ -391,7 +416,8 @@ declare namespace Primordials {
391416
export const SetPrototypeForEach: UncurryThis<typeof Set.prototype.forEach>
392417
export const SetPrototypeValues: UncurryThis<typeof Set.prototype.values>
393418
export const SetPrototypeKeys: UncurryThis<typeof Set.prototype.keys>
394-
export const String: typeof globalThis.String;
419+
export const SetPrototypeGetSize: UncurryGetter<typeof Set.prototype, "size">;
420+
export import String = globalThis.String;
395421
export const StringLength: typeof String.length
396422
export const StringName: typeof String.name
397423
export const StringPrototype: typeof String.prototype
@@ -445,7 +471,7 @@ declare namespace Primordials {
445471
export const StringPrototypeToUpperCase: UncurryThis<typeof String.prototype.toUpperCase>
446472
export const StringPrototypeValueOf: UncurryThis<typeof String.prototype.valueOf>
447473
export const StringPrototypeReplaceAll: UncurryThis<typeof String.prototype.replaceAll>
448-
export const Symbol: typeof globalThis.Symbol;
474+
export import Symbol = globalThis.Symbol;
449475
export const SymbolLength: typeof Symbol.length
450476
export const SymbolName: typeof Symbol.name
451477
export const SymbolPrototype: typeof Symbol.prototype
@@ -466,54 +492,97 @@ declare namespace Primordials {
466492
export const SymbolUnscopables: typeof Symbol.unscopables
467493
export const SymbolPrototypeToString: UncurryThis<typeof Symbol.prototype.toString>
468494
export const SymbolPrototypeValueOf: UncurryThis<typeof Symbol.prototype.valueOf>
469-
export const SyntaxError: typeof globalThis.SyntaxError;
495+
export const SymbolPrototypeSymbolToPrimitive: UncurryMethod<typeof Symbol.prototype, typeof Symbol.toPrimitive, symbol | Symbol>;
496+
export const SymbolPrototypeGetDescription: UncurryGetter<typeof Symbol.prototype, "description", symbol | Symbol>;
497+
export import SyntaxError = globalThis.SyntaxError;
470498
export const SyntaxErrorLength: typeof SyntaxError.length
471499
export const SyntaxErrorName: typeof SyntaxError.name
472500
export const SyntaxErrorPrototype: typeof SyntaxError.prototype
473-
export const TypeError: typeof globalThis.TypeError;
501+
export import TypeError = globalThis.TypeError;
474502
export const TypeErrorLength: typeof TypeError.length
475503
export const TypeErrorName: typeof TypeError.name
476504
export const TypeErrorPrototype: typeof TypeError.prototype
477-
export const URIError: typeof globalThis.URIError;
505+
export function TypedArrayFrom<T extends TypedArray>(
506+
constructor: new (length: number) => T,
507+
source:
508+
| Iterable<TypedArrayContentType<T>>
509+
| ArrayLike<TypedArrayContentType<T>>,
510+
): T;
511+
export function TypedArrayFrom<T extends TypedArray, U, THIS_ARG = undefined>(
512+
constructor: new (length: number) => T,
513+
source: Iterable<U> | ArrayLike<U>,
514+
mapfn: (
515+
this: THIS_ARG,
516+
value: U,
517+
index: number,
518+
) => TypedArrayContentType<T>,
519+
thisArg?: THIS_ARG,
520+
): T;
521+
export function TypedArrayOf<T extends TypedArray>(
522+
constructor: new (length: number) => T,
523+
...items: readonly TypedArrayContentType<T>[]
524+
): T;
525+
export function TypedArrayOfApply<T extends TypedArray>(
526+
constructor: new (length: number) => T,
527+
items: readonly TypedArrayContentType<T>[],
528+
): T;
529+
export const TypedArrayPrototypeGetBuffer: UncurryGetter<TypedArray, "buffer">;
530+
export const TypedArrayPrototypeGetByteLength: UncurryGetter<TypedArray, "byteLength">;
531+
export const TypedArrayPrototypeGetByteOffset: UncurryGetter<TypedArray, "byteOffset">;
532+
export const TypedArrayPrototypeGetLength: UncurryGetter<TypedArray, "length">;
533+
export function TypedArrayPrototypeGetSymbolToStringTag(self: unknown):
534+
| 'Int8Array'
535+
| 'Int16Array'
536+
| 'Int32Array'
537+
| 'Uint8Array'
538+
| 'Uint16Array'
539+
| 'Uint32Array'
540+
| 'Uint8ClampedArray'
541+
| 'BigInt64Array'
542+
| 'BigUint64Array'
543+
| 'Float32Array'
544+
| 'Float64Array'
545+
| undefined;
546+
export import URIError = globalThis.URIError;
478547
export const URIErrorLength: typeof URIError.length
479548
export const URIErrorName: typeof URIError.name
480549
export const URIErrorPrototype: typeof URIError.prototype
481-
export const Uint16Array: typeof globalThis.Uint16Array;
550+
export import Uint16Array = globalThis.Uint16Array;
482551
export const Uint16ArrayLength: typeof Uint16Array.length
483552
export const Uint16ArrayName: typeof Uint16Array.name
484553
export const Uint16ArrayPrototype: typeof Uint16Array.prototype
485554
export const Uint16ArrayBYTES_PER_ELEMENT: typeof Uint16Array.BYTES_PER_ELEMENT
486-
export const Uint32Array: typeof globalThis.Uint32Array;
555+
export import Uint32Array = globalThis.Uint32Array;
487556
export const Uint32ArrayLength: typeof Uint32Array.length
488557
export const Uint32ArrayName: typeof Uint32Array.name
489558
export const Uint32ArrayPrototype: typeof Uint32Array.prototype
490559
export const Uint32ArrayBYTES_PER_ELEMENT: typeof Uint32Array.BYTES_PER_ELEMENT
491-
export const Uint8Array: typeof globalThis.Uint8Array;
560+
export import Uint8Array = globalThis.Uint8Array;
492561
export const Uint8ArrayLength: typeof Uint8Array.length
493562
export const Uint8ArrayName: typeof Uint8Array.name
494563
export const Uint8ArrayPrototype: typeof Uint8Array.prototype
495564
export const Uint8ArrayBYTES_PER_ELEMENT: typeof Uint8Array.BYTES_PER_ELEMENT
496-
export const Uint8ClampedArray: typeof globalThis.Uint8ClampedArray;
565+
export import Uint8ClampedArray = globalThis.Uint8ClampedArray;
497566
export const Uint8ClampedArrayLength: typeof Uint8ClampedArray.length
498567
export const Uint8ClampedArrayName: typeof Uint8ClampedArray.name
499568
export const Uint8ClampedArrayPrototype: typeof Uint8ClampedArray.prototype
500569
export const Uint8ClampedArrayBYTES_PER_ELEMENT: typeof Uint8ClampedArray.BYTES_PER_ELEMENT
501-
export const WeakMap: typeof globalThis.WeakMap;
570+
export import WeakMap = globalThis.WeakMap;
502571
export const WeakMapLength: typeof WeakMap.length
503572
export const WeakMapName: typeof WeakMap.name
504573
export const WeakMapPrototype: typeof WeakMap.prototype
505574
export const WeakMapPrototypeDelete: UncurryThis<typeof WeakMap.prototype.delete>
506575
export const WeakMapPrototypeGet: UncurryThis<typeof WeakMap.prototype.get>
507576
export const WeakMapPrototypeSet: UncurryThis<typeof WeakMap.prototype.set>
508577
export const WeakMapPrototypeHas: UncurryThis<typeof WeakMap.prototype.has>
509-
export const WeakSet: typeof globalThis.WeakSet;
578+
export import WeakSet = globalThis.WeakSet;
510579
export const WeakSetLength: typeof WeakSet.length
511580
export const WeakSetName: typeof WeakSet.name
512581
export const WeakSetPrototype: typeof WeakSet.prototype
513582
export const WeakSetPrototypeDelete: UncurryThis<typeof WeakSet.prototype.delete>
514583
export const WeakSetPrototypeHas: UncurryThis<typeof WeakSet.prototype.has>
515584
export const WeakSetPrototypeAdd: UncurryThis<typeof WeakSet.prototype.add>
516-
export const Promise: typeof globalThis.Promise;
585+
export import Promise = globalThis.Promise;
517586
export const PromiseLength: typeof Promise.length
518587
export const PromiseName: typeof Promise.name
519588
export const PromisePrototype: typeof Promise.prototype
@@ -527,7 +596,3 @@ declare namespace Primordials {
527596
export const PromisePrototypeCatch: UncurryThis<typeof Promise.prototype.catch>
528597
export const PromisePrototypeFinally: UncurryThis<typeof Promise.prototype.finally>
529598
}
530-
531-
declare global {
532-
const primordials: typeof Primordials;
533-
}

0 commit comments

Comments
 (0)
Please sign in to comment.