-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
lib Update Request
Configuration Check
My compilation target is ESNext and my lib is the default.
Missing / Incorrect Definition
Typed array constructors (Int8Array, Float32Array, BigInt64Array, etc.) are missing an iterable overload that transforms from some non-number/bigint type to the desired number/bigint type.
Sample Code
console.log(
Int32Array.from(new Set(["1", "2", "3"]), (value) => Number(value) ** 2).join(", ")
);No overload matches this call.
Overload 1 of 3, '(arrayLike: Iterable<number>, mapfn?: ((v: number, k: number) => number) | undefined, thisArg?: any): Int32Array', gave the following error.
Argument of type 'Set<string>' is not assignable to parameter of type 'Iterable<number>'.
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
Type 'IteratorResult<string, any>' is not assignable to type 'IteratorResult<number, any>'.
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorResult<number, any>'.
Type 'IteratorYieldResult<string>' is not assignable to type 'IteratorYieldResult<number>'.
Type 'string' is not assignable to type 'number'.
Overload 2 of 3, '(arrayLike: ArrayLike<unknown>, mapfn: (v: unknown, k: number) => number, thisArg?: any): Int32Array', gave the following error.
Argument of type 'Set<string>' is not assignable to parameter of type 'ArrayLike<unknown>'.
Property 'length' is missing in type 'Set<string>' but required in type 'ArrayLike<unknown>'.
Documentation Link
Metadata
Metadata
Assignees
Labels
Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone