@@ -19,7 +19,7 @@ type UncurryGetter<O, K extends keyof O, T = O> =
1919type UncurrySetter < O , K extends keyof O , T = O > =
2020 O [ K ] extends infer V ? ( self : T , value : V ) => void : never ;
2121
22- type TypedArrayContentType < T extends TypedArray > = T extends { [ k : number ] : infer V } ? V : never ;
22+ type TypedArrayContentType < T extends TypedArrayConstructor > = InstanceType < T > [ number ] ;
2323
2424/**
2525 * Primordials are a way to safely use globals without fear of global mutation
@@ -472,43 +472,30 @@ declare namespace primordials {
472472 export const SyntaxErrorPrototype : typeof SyntaxError . prototype
473473 export import TypeError = globalThis . TypeError ;
474474 export const TypeErrorPrototype : typeof TypeError . prototype
475- export function TypedArrayFrom < T extends TypedArray > (
476- constructor : new ( length : number ) => T ,
477- source :
478- | Iterable < TypedArrayContentType < T > >
479- | ArrayLike < TypedArrayContentType < T > > ,
480- ) : T ;
481- export function TypedArrayFrom < T extends TypedArray , U , THIS_ARG = undefined > (
482- constructor : new ( length : number ) => T ,
475+ export function TypedArrayFrom < T extends TypedArrayConstructor > (
476+ constructor : T ,
477+ source : Iterable < TypedArrayContentType < T > > | ArrayLike < TypedArrayContentType < T > > ,
478+ ) : InstanceType < T >
479+ export function TypedArrayFrom < T extends TypedArrayConstructor , U , THIS_ARG = undefined > (
480+ constructor : T ,
483481 source : Iterable < U > | ArrayLike < U > ,
484482 mapfn : (
485483 this : THIS_ARG ,
486484 value : U ,
487485 index : number ,
488486 ) => TypedArrayContentType < T > ,
489487 thisArg ?: THIS_ARG ,
490- ) : T ;
491- export function TypedArrayOf < T extends TypedArray > (
492- constructor : new ( length : number ) => T ,
493- ...items : readonly TypedArrayContentType < T > [ ]
494- ) : T ;
495- export function TypedArrayOfApply < T extends TypedArray > (
496- constructor : new ( length : number ) => T ,
488+ ) : InstanceType < T > ;
489+ export function TypedArrayOf < T extends TypedArrayConstructor > (
490+ constructor : T ,
491+ ...items : TypedArrayContentType < T > [ ] ,
492+ ) : InstanceType < T > ;
493+ export function TypedArrayOfApply < T extends TypedArrayConstructor > (
494+ constructor : T ,
497495 items : readonly TypedArrayContentType < T > [ ] ,
498- ) : T ;
499- export const TypedArray : TypedArray ;
500- export const TypedArrayPrototype :
501- | typeof Uint8Array . prototype
502- | typeof Int8Array . prototype
503- | typeof Uint16Array . prototype
504- | typeof Int16Array . prototype
505- | typeof Uint32Array . prototype
506- | typeof Int32Array . prototype
507- | typeof Float32Array . prototype
508- | typeof Float64Array . prototype
509- | typeof BigInt64Array . prototype
510- | typeof BigUint64Array . prototype
511- | typeof Uint8ClampedArray . prototype ;
496+ ) : InstanceType < T > ;
497+ export const TypedArray : TypedArrayConstructor ;
498+ export const TypedArrayPrototype : TypedArrayConstructor [ "prototype" ] ;
512499 export const TypedArrayPrototypeGetBuffer : UncurryGetter < TypedArray , "buffer" > ;
513500 export const TypedArrayPrototypeGetByteLength : UncurryGetter < TypedArray , "byteLength" > ;
514501 export const TypedArrayPrototypeGetByteOffset : UncurryGetter < TypedArray , "byteOffset" > ;
@@ -519,19 +506,7 @@ declare namespace primordials {
519506 export function TypedArrayPrototypeSet < T extends TypedArray > ( self : T , ...args : Parameters < T [ "set" ] > ) : ReturnType < T [ "set" ] > ;
520507 export function TypedArrayPrototypeSubarray < T extends TypedArray > ( self : T , ...args : Parameters < T [ "subarray" ] > ) : ReturnType < T [ "subarray" ] > ;
521508 export function TypedArrayPrototypeSlice < T extends TypedArray > ( self : T , ...args : Parameters < T [ "slice" ] > ) : ReturnType < T [ "slice" ] > ;
522- export function TypedArrayPrototypeGetSymbolToStringTag ( self : unknown ) :
523- | 'Int8Array'
524- | 'Int16Array'
525- | 'Int32Array'
526- | 'Uint8Array'
527- | 'Uint16Array'
528- | 'Uint32Array'
529- | 'Uint8ClampedArray'
530- | 'BigInt64Array'
531- | 'BigUint64Array'
532- | 'Float32Array'
533- | 'Float64Array'
534- | undefined ;
509+ export function TypedArrayPrototypeGetSymbolToStringTag ( self : unknown ) : TypedArray [ typeof Symbol . toStringTag ] | undefined ;
535510 export import URIError = globalThis . URIError ;
536511 export const URIErrorPrototype : typeof URIError . prototype
537512 export import Uint16Array = globalThis . Uint16Array ;
0 commit comments