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

Type Declarations for Iterator.from #26783

Closed
chances opened this issue Nov 8, 2024 · 2 comments
Closed

Type Declarations for Iterator.from #26783

chances opened this issue Nov 8, 2024 · 2 comments

Comments

@chances
Copy link

chances commented Nov 8, 2024

The TypeScript team have resecently made some changes to the Iterator group of interfaces, protocols, and their related type definitions. For context, the TypeScript team is in the middle of making changes to the type declarations regarding iterators after TC39 recently landed changes for iterator helpers.

Either I'm confused and am using the types incorrectly, or the version of TypeScript being used by Deno is outdated.

My apologies if this is the incorrect repository.

Reproduction

index.ts:

return Iterator.from([1, 2, 3]).map(x => x * 2);

deno.json:

{
  "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
  "exports": "./index.ts",
  "compilerOptions": {
    "lib": ["ESNext", "DOM.Iterable", "deno.window"]
  }
}

Error reported by the Deno language server

ts: 'Iterator' only refers to a type, but is being used as a value here.

Deno Runtime Versions

Deno 2.0.5 (stable, release, x86_64-pc-windows-msvc)
V8 12.9.202.13-rusty
TypeScript 5.6.2

References

@chances chances changed the title Outdated TypeScript, re: JS library definitions for ` Outdated TypeScript, re: JS library definitions for Iterator.from. Nov 8, 2024
@chances chances changed the title Outdated TypeScript, re: JS library definitions for Iterator.from. Outdated TypeScript, re: JS Type Declarations for Iterator.from Nov 8, 2024
@petamoriken
Copy link
Contributor

TypeScript 5.7 is in beta now and will be released on 2024-11-21.

Please see #26705

@chances chances changed the title Outdated TypeScript, re: JS Type Declarations for Iterator.from Type Declarations for Iterator.from Nov 8, 2024
@dsherret
Copy link
Member

Let's track this in #26950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants