From 2040bde7e0f3c4a90bcb41d41b7882668e35d751 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Mon, 1 Jan 2024 09:19:48 +0100 Subject: [PATCH] Add type for import.meta.url Add to dom compatibility module because Typescript also defines this in its dom module, see https://github.com/saschanaz/types-web/blob/87cdc80239a5218065a4bde410583f0488b3073b/baselines/dom.generated.d.ts#L661 --- packages/generator-typescript/templates/gjs/dom.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/generator-typescript/templates/gjs/dom.d.ts b/packages/generator-typescript/templates/gjs/dom.d.ts index e8332c198..f7e3f0079 100644 --- a/packages/generator-typescript/templates/gjs/dom.d.ts +++ b/packages/generator-typescript/templates/gjs/dom.d.ts @@ -13,6 +13,15 @@ declare global { + interface ImportMeta { + /** + * The absolute file: or resource: URL of the module. + * + * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/doc/ESModules.md#importmetaurl + */ + readonly url: string; + } + // Timers // See https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/esm/_timers.js