summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/broadcast_channel/lib.rs6
-rw-r--r--ext/console/lib.rs5
-rw-r--r--ext/crypto/lib.rs5
-rw-r--r--ext/fetch/lib.rs5
-rw-r--r--ext/net/lib.rs5
-rw-r--r--ext/url/lib.rs5
-rw-r--r--ext/web/lib.rs5
-rw-r--r--ext/websocket/lib.rs5
-rw-r--r--ext/webstorage/lib.rs4
9 files changed, 45 insertions, 0 deletions
diff --git a/ext/broadcast_channel/lib.rs b/ext/broadcast_channel/lib.rs
index e228871b9..57287ffbc 100644
--- a/ext/broadcast_channel/lib.rs
+++ b/ext/broadcast_channel/lib.rs
@@ -15,6 +15,7 @@ use deno_core::Resource;
use deno_core::ResourceId;
use deno_core::ZeroCopyBuf;
use std::cell::RefCell;
+use std::path::PathBuf;
use std::rc::Rc;
#[async_trait]
@@ -126,3 +127,8 @@ pub fn init<BC: BroadcastChannel + 'static>(
})
.build()
}
+
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR"))
+ .join("lib.deno_broadcast_channel.d.ts")
+}
diff --git a/ext/console/lib.rs b/ext/console/lib.rs
index 03b3a79c0..6c5bba9fa 100644
--- a/ext/console/lib.rs
+++ b/ext/console/lib.rs
@@ -2,6 +2,7 @@
use deno_core::include_js_files;
use deno_core::Extension;
+use std::path::PathBuf;
pub fn init() -> Extension {
Extension::builder()
@@ -12,3 +13,7 @@ pub fn init() -> Extension {
))
.build()
}
+
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_console.d.ts")
+}
diff --git a/ext/crypto/lib.rs b/ext/crypto/lib.rs
index a2dc8e626..3515013f8 100644
--- a/ext/crypto/lib.rs
+++ b/ext/crypto/lib.rs
@@ -51,6 +51,7 @@ use sha2::Sha256;
use sha2::Sha384;
use sha2::Sha512;
use std::convert::TryFrom;
+use std::path::PathBuf;
pub use rand; // Re-export rand
@@ -881,3 +882,7 @@ pub fn op_crypto_unwrap_key(
_ => Err(type_error("Unsupported algorithm")),
}
}
+
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_crypto.d.ts")
+}
diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs
index 59d5f9a6b..b744a9bbd 100644
--- a/ext/fetch/lib.rs
+++ b/ext/fetch/lib.rs
@@ -45,6 +45,7 @@ use std::borrow::Cow;
use std::cell::RefCell;
use std::convert::From;
use std::path::Path;
+use std::path::PathBuf;
use std::pin::Pin;
use std::rc::Rc;
use tokio::io::AsyncReadExt;
@@ -170,6 +171,10 @@ pub trait FetchPermissions {
fn check_read(&mut self, _p: &Path) -> Result<(), AnyError>;
}
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_fetch.d.ts")
+}
+
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FetchArgs {
diff --git a/ext/net/lib.rs b/ext/net/lib.rs
index 84358210e..c95348020 100644
--- a/ext/net/lib.rs
+++ b/ext/net/lib.rs
@@ -14,6 +14,7 @@ use deno_core::OpState;
use deno_tls::rustls::RootCertStore;
use std::cell::RefCell;
use std::path::Path;
+use std::path::PathBuf;
use std::rc::Rc;
pub trait NetPermissions {
@@ -60,6 +61,10 @@ pub fn check_unstable2(state: &Rc<RefCell<OpState>>, api_name: &str) {
state.borrow::<UnstableChecker>().check_unstable(api_name)
}
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_net.d.ts")
+}
+
#[derive(Clone)]
pub struct DefaultTlsOptions {
pub root_cert_store: Option<RootCertStore>,
diff --git a/ext/url/lib.rs b/ext/url/lib.rs
index 0fa389fb0..46e363bc3 100644
--- a/ext/url/lib.rs
+++ b/ext/url/lib.rs
@@ -14,6 +14,7 @@ use deno_core::url::Url;
use deno_core::Extension;
use deno_core::ZeroCopyBuf;
use std::panic::catch_unwind;
+use std::path::PathBuf;
use crate::urlpattern::op_urlpattern_parse;
use crate::urlpattern::op_urlpattern_process_match_input;
@@ -186,3 +187,7 @@ pub fn op_url_stringify_search_params(
.finish();
Ok(search)
}
+
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_url.d.ts")
+}
diff --git a/ext/web/lib.rs b/ext/web/lib.rs
index d199b7bfe..21fa285ba 100644
--- a/ext/web/lib.rs
+++ b/ext/web/lib.rs
@@ -27,6 +27,7 @@ use serde::Serialize;
use std::borrow::Cow;
use std::cell::RefCell;
use std::fmt;
+use std::path::PathBuf;
use std::usize;
use crate::blob::op_blob_create_object_url;
@@ -352,6 +353,10 @@ fn op_encoding_encode_into(
})
}
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_web.d.ts")
+}
+
#[derive(Debug)]
pub struct DomExceptionQuotaExceededError {
pub msg: String,
diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs
index 0b9470274..95afd79bd 100644
--- a/ext/websocket/lib.rs
+++ b/ext/websocket/lib.rs
@@ -33,6 +33,7 @@ use std::borrow::Cow;
use std::cell::RefCell;
use std::convert::TryFrom;
use std::fmt;
+use std::path::PathBuf;
use std::rc::Rc;
use std::sync::Arc;
use tokio::net::TcpStream;
@@ -505,6 +506,10 @@ pub fn init<P: WebSocketPermissions + 'static>(
.build()
}
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_websocket.d.ts")
+}
+
#[derive(Debug)]
pub struct DomExceptionNetworkError {
pub msg: String,
diff --git a/ext/webstorage/lib.rs b/ext/webstorage/lib.rs
index 8569fece6..7cda0176a 100644
--- a/ext/webstorage/lib.rs
+++ b/ext/webstorage/lib.rs
@@ -43,6 +43,10 @@ pub fn init(origin_storage_dir: Option<PathBuf>) -> Extension {
.build()
}
+pub fn get_declaration() -> PathBuf {
+ PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_webstorage.d.ts")
+}
+
struct LocalStorage(Connection);
struct SessionStorage(Connection);