summaryrefslogtreecommitdiff
path: root/cli/dts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-07-18 20:05:26 +0200
committerGitHub <noreply@github.com>2022-07-18 20:05:26 +0200
commit999cbfb52bc42c58467e3592d5fead9c4ee8a2c1 (patch)
tree5f5336420b675e15cfaa44cf205171623a3f4ab1 /cli/dts
parent0d73eb3dd91b5b34bb6c38a25a4e6aac411d38f3 (diff)
feat: import.meta.resolve() (#15074)
This commit adds new "import.meta.resolve()" API which allows to resolve specifiers relative to the module the API is called in. This API supports resolving using import maps.
Diffstat (limited to 'cli/dts')
-rw-r--r--cli/dts/lib.deno.ns.d.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index b13acc238..e5499c93e 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -21,6 +21,16 @@ declare interface ImportMeta {
* ```
*/
main: boolean;
+
+ /** A function that returns resolved specifier as if it would be imported
+ * using `import(specifier)`.
+ *
+ * ```ts
+ * console.log(import.meta.resolve("./foo.js"));
+ * // file:///dev/foo.js
+ * ```
+ */
+ resolve(specifier: string): string;
}
/** Deno supports user timing Level 3 (see: https://w3c.github.io/user-timing)