summaryrefslogtreecommitdiff
path: root/extensions/web/lib.rs
diff options
context:
space:
mode:
authorAndy Hayden <andyhayden1@gmail.com>2021-04-30 12:51:48 -0700
committerGitHub <noreply@github.com>2021-04-30 15:51:48 -0400
commit684c357136fd44f9d5a1b8bb4402400ed1354677 (patch)
treeebc14b1d01b6643dd4d588516692dffc0f8fcb52 /extensions/web/lib.rs
parentabaec7a88e991188d885bede652f35d76ab4f340 (diff)
Rename crate_ops to extensions (#10431)
Diffstat (limited to 'extensions/web/lib.rs')
-rw-r--r--extensions/web/lib.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/extensions/web/lib.rs b/extensions/web/lib.rs
new file mode 100644
index 000000000..0d2dbbd78
--- /dev/null
+++ b/extensions/web/lib.rs
@@ -0,0 +1,26 @@
+// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+
+use deno_core::include_js_files;
+use deno_core::Extension;
+use std::path::PathBuf;
+
+/// Load and execute the javascript code.
+pub fn init() -> Extension {
+ Extension::builder()
+ .js(include_js_files!(
+ prefix "deno:extensions/web",
+ "00_infra.js",
+ "01_dom_exception.js",
+ "01_mimesniff.js",
+ "02_event.js",
+ "03_abort_signal.js",
+ "04_global_interfaces.js",
+ "08_text_encoding.js",
+ "12_location.js",
+ ))
+ .build()
+}
+
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_web.d.ts")
+}