-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Missing ListFormat types? #13199
Comments
Can you provide a full reproduction and include the output of |
This is literally my entire code in a file called const ListFormatter = new Intl.ListFormat("en", {
style: "long",
type: "conjunction",
});
console.log(ListFormatter.format(["apples", "pears", "peaches", "plums"])); Here's what happens when I run it: [listFormat] deno run ./mod.ts
Check file:///Users/chasm/Workspace/listFormat/mod.ts
error: TS2339 [ERROR]: Property 'ListFormat' does not exist on type 'typeof Intl'.
const ListFormatter = new Intl.ListFormat("en", {
~~~~~~~~~~
at file:///Users/chasm/Workspace/listFormat/mod.ts:1:32 Here is the output of [listFormat] deno --version
deno 1.17.1 (release, x86_64-apple-darwin)
v8 9.7.106.15
typescript 4.5.2 Here is what happens when I do the same thing in the REPL: [listFormat] deno
Deno 1.17.1
exit using ctrl+d or close()
> const ListFormatter = new Intl.ListFormat("en", {
style: "long",
type: "conjunction",
});
console.log(ListFormatter.format(["apples", "pears", "peaches", "plums"]));
apples, pears, peaches, and plums
undefined
> As the output is correct, clearly Ideas? Is there a workaround? |
This is an issue with typescript itself: microsoft/TypeScript#46907 |
Thanks. I'll check on it there. |
We have added built-in APIs to the Typescript definition files when a version of Deno would ship with those APIs but Typescript didn't support them yet (see #11443, for example). The differences here is that |
That would be awesome... |
V8 has supported `Intl.ListFormat` since version 7.2, but TypeScript doesn't have typings for it yet. This PR manually adds those typings, copying them from mirosoft/TypeScript#47254. Fixes denoland#13199.
V8 has supported `Intl.ListFormat` since version 7.2, but TypeScript doesn't have typings for it yet. This PR manually adds those typings, copying them from microsoft/TypeScript#47254. Fixes denoland#13199.
I can do this in the REPL and it works:
But if I put the same code in my Deno application, I get:
when I try to bundle it.
The text was updated successfully, but these errors were encountered: