From 32cfbab2425fb9b42b9211c6ebf90960339fc935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Nilsved?= Date: Tue, 8 Aug 2023 16:55:47 +0200 Subject: [PATCH] Revert "Remove temporary namespace extension" This reverts commit 72d2cdceefaa03ca6ddc2018289614f2f796b3b8. --- utils/supportedCanonicalTimezones.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/utils/supportedCanonicalTimezones.ts b/utils/supportedCanonicalTimezones.ts index 18c20ba..9ba1c6c 100644 --- a/utils/supportedCanonicalTimezones.ts +++ b/utils/supportedCanonicalTimezones.ts @@ -1,3 +1,22 @@ +/** + * Intl.supportedValuesOf is not shipped until Typescript 5.1 + * Temporary workaround is from + * https://github.com/microsoft/TypeScript/issues/49231#issuecomment-1137251612 + * + * TODO: When Typescript 5.1 is released with Deno (check with `deno --version`), remove this namespace extension. + */ +declare namespace Intl { + type Key = + | "calendar" + | "collation" + | "currency" + | "numberingSystem" + | "timeZone" + | "unit"; + + function supportedValuesOf(input: Key): string[]; +} + /** * Get all canonical timezones that are supported by the browser or runtime, * or an empty array if the list is not available.