2021-01-12 02:13:41 +09:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2020-08-07 16:55:02 +02:00
|
|
|
|
2021-04-28 18:41:50 +02:00
|
|
|
use deno_core::include_js_files;
|
|
|
|
use deno_core::Extension;
|
2020-09-30 16:51:01 +02:00
|
|
|
use std::path::PathBuf;
|
2020-08-07 16:55:02 +02:00
|
|
|
|
2020-09-30 16:51:01 +02:00
|
|
|
/// Load and execute the javascript code.
|
2021-04-28 18:41:50 +02:00
|
|
|
pub fn init() -> Extension {
|
2021-04-29 00:16:45 +02:00
|
|
|
Extension::builder()
|
|
|
|
.js(include_js_files!(
|
2021-04-30 12:51:48 -07:00
|
|
|
prefix "deno:extensions/web",
|
2021-04-29 00:16:45 +02:00
|
|
|
"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()
|
2020-08-07 16:55:02 +02:00
|
|
|
}
|
|
|
|
|
2020-09-01 16:32:07 -04:00
|
|
|
pub fn get_declaration() -> PathBuf {
|
2020-09-09 13:23:57 +01:00
|
|
|
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_web.d.ts")
|
2020-08-07 16:55:02 +02:00
|
|
|
}
|