-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Open
Labels
Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
⚙ Compilation target
ES5+
⚙ Library
lib.es5.d.ts, lib.es2022.bigint.d.ts
Missing / Incorrect Definition
Suggesting to change the BYTES_PER_ELEMENT static and instance properties as follows:
interface Uint8Array {
// ...
- readonly BYTES_PER_ELEMENT: number;
+ readonly BYTES_PER_ELEMENT: 1;
// ...
}interface BigInt64ArrayConstructor {
// ...
- readonly BYTES_PER_ELEMENT: number;
+ readonly BYTES_PER_ELEMENT: 8;
// ...
}Etc.
Sample Code
declare function fn(bytesPerElement: 1 | 2 | 4 | 8): void
// currently reports "Argument of type 'number' is not assignable to parameter of type '1 | 2 | 4 | 8'".
fn(Uint32Array.BYTES_PER_ELEMENT)Documentation Link
Reactions are currently unavailable
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 TypeScriptExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript