You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
declarefunctionfn(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)
⚙ Compilation target
ES5+
⚙ Library
lib.es5.d.ts, lib.es2022.bigint.d.ts
Missing / Incorrect Definition
Suggesting to change the
BYTES_PER_ELEMENTstatic 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
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT#examples