Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types for ArrayBuffer.transfer and ArrayBuffer.transferToFixedLength are missing. #26705

Closed
BlackAsLight opened this issue Nov 4, 2024 · 7 comments
Assignees
Labels
tsc related to the TypeScript tsc compiler upstream Changes in upstream are required to solve these issues

Comments

@BlackAsLight
Copy link

Version: Deno 2.0.4

According to MDN docs, Deno supports both .transfer() and .transferToFixedLength() while Node doesn't, and this is true when running the code, but the TypeScript linting doesn't display these options. Saying it doesn't exist.

@petamoriken
Copy link
Contributor

TypeScript 5.7 will include ES2024 type definitions. Please wait a moment.
https://devblogs.microsoft.com/typescript/announcing-typescript-5-7-beta/#support-for---target-es2024-and---lib-es2024

@petamoriken
Copy link
Contributor

Looks like a duplicate of #25993

@BlackAsLight
Copy link
Author

Is there a scheduled date for when 5.7 will be released?

@petamoriken
Copy link
Contributor

It will be released on 2024-11-21.
microsoft/TypeScript#59905

@bartlomieju
Copy link
Member

Oh this is gonna be a tight one, we are scheduled to release on Nov, 21st too. Maybe we'll delay by one day to include TS upgrade.

@bartlomieju bartlomieju added upstream Changes in upstream are required to solve these issues tsc related to the TypeScript tsc compiler labels Nov 4, 2024
@petamoriken
Copy link
Contributor

petamoriken commented Nov 4, 2024

NOTE:

TypeScript 5.7 will bring a breaking change that will make TypedArrays generic.

In ECMAScript 2024, SharedArrayBuffer and ArrayBuffer have types that slightly diverge. To bridge the gap and preserve the underlying buffer type, all TypedArrays (like Uint8Array and others) are now also generic.

interface Uint8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
    // ...
}

https://devblogs.microsoft.com/typescript/announcing-typescript-5-7-beta/#typedarrays-are-now-generic-over-arraybufferlike

Type definition files will need to be updated and @types/node will need to be pinned to v22.7.4 or later.

// WARNING: When bumping this version, check if anything needs to be
// updated in the `setNodeOnlyGlobalNames` call in 99_main_compiler.js
types_node_version_req: Some(
VersionReq::parse_from_npm("22.0.0 - 22.5.4").unwrap(),
),
},

@bartlomieju bartlomieju added this to the 2.1.0 milestone Nov 4, 2024
@dsherret dsherret removed this from the 2.1.0 milestone Nov 20, 2024
@dsherret
Copy link
Member

Tracking in #26950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tsc related to the TypeScript tsc compiler upstream Changes in upstream are required to solve these issues
Projects
None yet
Development

No branches or pull requests

4 participants