diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..08d64e064 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "rust-analyzer.check.overrideCommand": [ + "cargo", + "check", + "--package=clarinet-cli", + "--message-format=json" + ] +} diff --git a/Cargo.lock b/Cargo.lock index a85edfdfb..aa56f319c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,61 +27,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aes" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" -dependencies = [ - "cfg-if", - "cipher 0.4.4", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.0-pre" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8004e8b23ff2c65e28ff77bab0eccd36f4a6c2c8e0b55c46acba481425cc3a4f" -dependencies = [ - "aead", - "aes 0.8.2", - "cipher 0.4.4", - "ctr", - "ghash", - "subtle 2.4.1", -] - -[[package]] -name = "aes-kw" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fa2b352dcefb5f7f3a5fb840e02665d311d878955380515e4fd50095dd3d8c" -dependencies = [ - "aes 0.8.2", -] - [[package]] name = "ahash" version = "0.7.6" @@ -102,21 +47,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "android_system_properties" version = "0.1.5" @@ -189,12 +119,6 @@ version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" -[[package]] -name = "anymap" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" - [[package]] name = "arc-swap" version = "1.6.0" @@ -224,26 +148,12 @@ checksum = "cf94863c5fdfee166d0907c44e5fee970123b2b7307046d35d1e671aa93afbba" dependencies = [ "darling", "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "swc_macros_common", "syn 1.0.107", ] -[[package]] -name = "async-compression" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" -dependencies = [ - "brotli", - "flate2", - "futures-core", - "memchr", - "pin-project-lite", - "tokio", -] - [[package]] name = "async-stream" version = "0.3.4" @@ -261,8 +171,8 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -272,8 +182,8 @@ version = "0.1.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -297,18 +207,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "auto_impl" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" -dependencies = [ - "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.28", - "syn 1.0.107", -] - [[package]] name = "auto_impl" version = "1.0.1" @@ -316,8 +214,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a8c1df849285fbacd587de7818cc7d13be6cd2cbcd47a04fb1801b0e2706e33" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -348,12 +246,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base58" version = "0.1.0" @@ -366,12 +258,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - [[package]] name = "base64" version = "0.12.3" @@ -399,15 +285,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "base64-simd" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278c7ba87265587c4823cf1b2fdf57834151540b2e509574adb03627f8c7f22d" -dependencies = [ - "simd-abstraction", -] - [[package]] name = "base64ct" version = "1.5.3" @@ -539,12 +416,6 @@ dependencies = [ "generic-array 0.14.6", ] -[[package]] -name = "block-modes" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2211b0817f061502a8dd9f11a37e879e79763e3c698d2418cf824d8cb2f21e" - [[package]] name = "block-padding" version = "0.1.5" @@ -560,15 +431,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "block-padding" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a90ec2df9600c28a01c56c4784c9207a96d2451833aeceb8cc97e4c9548bb78" -dependencies = [ - "generic-array 0.14.6", -] - [[package]] name = "bollard" version = "0.11.1" @@ -610,27 +472,6 @@ dependencies = [ "serde_with", ] -[[package]] -name = "brotli" -version = "3.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bumpalo" version = "3.13.0" @@ -667,23 +508,11 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" -[[package]] -name = "cbc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" -dependencies = [ - "cipher 0.4.4", -] - [[package]] name = "cc" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -dependencies = [ - "jobserver", -] [[package]] name = "cfg-if" @@ -755,25 +584,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap" version = "3.2.23" @@ -831,8 +641,8 @@ checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck 0.4.1", "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -843,8 +653,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 2.0.28", ] @@ -877,11 +687,9 @@ checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" name = "clarinet-cli" version = "1.8.0" dependencies = [ - "aes 0.7.5", "ansi_term", "atty", "base58 0.2.0", - "base64 0.13.1", "bitcoin", "cache_control", "chrono", @@ -896,24 +704,6 @@ dependencies = [ "crossterm 0.22.1", "ctrlc", "data-url", - "deno_ast", - "deno_broadcast_channel", - "deno_console", - "deno_core", - "deno_crypto", - "deno_emit", - "deno_fetch", - "deno_graph", - "deno_http", - "deno_net", - "deno_ops", - "deno_tls", - "deno_url", - "deno_web", - "deno_webidl", - "deno_websocket", - "deno_webstorage", - "dlopen", "dprint-plugin-json", "dprint-plugin-markdown", "dprint-plugin-typescript", @@ -926,33 +716,23 @@ dependencies = [ "hex 0.4.3", "hiro-system-kit 0.1.0", "hmac 0.12.1", - "http", - "hyper", "import_map", - "indexmap 1.9.2", "jsonc-parser 0.20.0", "lazy_static", "libc", "libsecp256k1 0.7.1", "log", - "lzzzz", "mac_address", "mio 0.8.6", "netif", "nix 0.24.2", - "node_resolver", - "notify", "num_cpus", - "once_cell", "os_pipe", "pbkdf2", "percent-encoding", "pin-project", - "rand 0.8.5", "regex", "reqwest", - "ring", - "rsa", "segment", "serde", "serde_derive", @@ -976,9 +756,7 @@ dependencies = [ "twox-hash", "typed-arena", "uuid", - "walkdir", "winapi", - "winres", ] [[package]] @@ -1015,7 +793,7 @@ dependencies = [ "js-sys", "libsecp256k1 0.7.1", "serde", - "serde-wasm-bindgen 0.5.0", + "serde-wasm-bindgen", "serde_derive", "serde_json", "tiny-hderive", @@ -1036,7 +814,7 @@ dependencies = [ "gloo-utils", "js-sys", "serde", - "serde-wasm-bindgen 0.6.0", + "serde-wasm-bindgen", "serde_json", "wasm-bindgen", "wasm-bindgen-futures", @@ -1111,7 +889,7 @@ dependencies = [ "lsp-types", "regex", "serde", - "serde-wasm-bindgen 0.5.0", + "serde-wasm-bindgen", "serde_json", "wasm-bindgen", "wasm-bindgen-futures", @@ -1173,7 +951,6 @@ dependencies = [ "memchr", "pico-args", "prettytable-rs", - "rand 0.7.3", "regex", "reqwest", "rustyline", @@ -1268,24 +1045,12 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "const-oid" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" - [[package]] name = "const_fn" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "cookie" version = "0.17.0" @@ -1297,16 +1062,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.3" @@ -1322,30 +1077,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -1412,18 +1143,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.6", - "rand_core 0.6.4", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -1481,15 +1200,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher 0.4.4", -] - [[package]] name = "ctrlc" version = "3.2.5" @@ -1535,8 +1245,8 @@ dependencies = [ "cc", "codespan-reporting", "once_cell", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "scratch", "syn 1.0.107", ] @@ -1553,8 +1263,8 @@ version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebf883b7aacd7b2aeb2a7b338648ee19f57c140d4ee8e52c68979c6b2f7f2263" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -1576,8 +1286,8 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "strsim", "syn 1.0.107", ] @@ -1589,7 +1299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", - "quote 1.0.28", + "quote", "syn 1.0.107", ] @@ -1606,12 +1316,6 @@ dependencies = [ "parking_lot_core 0.9.7", ] -[[package]] -name = "data-encoding" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" - [[package]] name = "data-url" version = "0.1.1" @@ -1647,385 +1351,75 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42fb7189dc0564d7fc4d422868aad20cc6051b4469dad5a39a34bc4741cbc9ec" dependencies = [ - "anyhow", - "base64 0.13.1", - "data-url", "dprint-swc-ext", "serde", "swc_atoms", - "swc_bundler", "swc_common", "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_codegen_macros", - "swc_ecma_dep_graph", - "swc_ecma_loader", "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_transforms_proposal", - "swc_ecma_transforms_react", - "swc_ecma_transforms_typescript", - "swc_ecma_utils", - "swc_ecma_visit", "text_lines 0.4.1", - "url", ] [[package]] -name = "deno_broadcast_channel" -version = "0.58.0" +name = "devise" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71feffc09d787b53b9e7d2a04edcc85a1809b51d6f02bae2e647bc1f3e349b1f" +checksum = "d6eacefd3f541c66fc61433d65e54e0e46e0a029a819a7dbbc7a7b489e8a85f8" dependencies = [ - "async-trait", - "deno_core", - "tokio", - "uuid", + "devise_codegen", + "devise_core", ] [[package]] -name = "deno_console" -version = "0.64.0" +name = "devise_codegen" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d225d8d668a1bcfa33e3add7f5a62d55b2fffb3dcca8c0148b971958f808a2d" +checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" dependencies = [ - "deno_core", + "devise_core", + "quote", ] [[package]] -name = "deno_core" -version = "0.146.0" +name = "devise_core" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88475da37fe0544b7372fd4705560df496498eb5eeb40ce19bfe7787ed0600ca" +checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" dependencies = [ - "anyhow", - "deno_ops", - "futures", - "indexmap 1.9.2", - "libc", - "log", - "once_cell", - "parking_lot 0.12.1", - "pin-project", - "serde", - "serde_json", - "serde_v8", - "sourcemap", - "url", - "v8", + "bitflags 2.3.1", + "proc-macro2", + "proc-macro2-diagnostics 0.10.0", + "quote", + "syn 2.0.28", ] [[package]] -name = "deno_crypto" -version = "0.78.0" +name = "digest" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "303b776f6495a6707952a30365c5d9b329fec59b809d79491d55ceaca579349e" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "aes 0.8.2", - "aes-gcm", - "aes-kw", - "base64 0.13.1", - "block-modes", - "cbc", - "const-oid", - "ctr", - "deno_core", - "deno_web", - "elliptic-curve", - "num-traits", - "once_cell", - "p256", - "p384", - "rand 0.8.5", - "ring", - "rsa", - "sec1", - "serde", - "serde_bytes", - "sha-1 0.10.1", - "sha2 0.10.6", - "spki", - "tokio", - "uuid", + "generic-array 0.12.4", ] [[package]] -name = "deno_emit" -version = "0.4.0" +name = "digest" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e2a0076182afa41ee8e697e7646facdcc069cca89df3b12ca982b5069758f4" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "anyhow", - "base64 0.13.1", - "deno_ast", - "deno_graph", - "futures", - "parking_lot 0.11.2", + "generic-array 0.14.6", ] [[package]] -name = "deno_fetch" -version = "0.87.0" +name = "digest" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5196cf566f7eed31c43f12848a57e60ff8d7bab41983e31877007c9aa8e76758" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "bytes", - "data-url", - "deno_core", - "deno_tls", - "dyn-clone", - "http", - "reqwest", - "serde", - "tokio", - "tokio-stream", - "tokio-util 0.7.7", -] - -[[package]] -name = "deno_graph" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c6cc4d05b21c0dc80825a5dfb911ee09826004c89215c1bb92cbc1c44118d5" -dependencies = [ - "anyhow", - "cfg-if", - "data-url", - "deno_ast", - "futures", - "lazy_static", - "parking_lot 0.12.1", - "regex", - "ring", - "serde", - "serde_json", - "sourcemap", - "termcolor", - "url", -] - -[[package]] -name = "deno_http" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c983b2b2cf956e027192bdf2a7cfbd51ad0fc2b4be4c89c0f5a9e59b56b8f32e" -dependencies = [ - "async-compression", - "base64 0.13.1", - "brotli", - "bytes", - "cache_control", - "deno_core", - "deno_websocket", - "flate2", - "fly-accept-encoding", - "hyper", - "mime", - "percent-encoding", - "phf", - "ring", - "serde", - "tokio", - "tokio-util 0.7.7", -] - -[[package]] -name = "deno_net" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "701ed13edef61aa96d39e70b679fa01ba7508f645f65bccf28fb20eca25fa36d" -dependencies = [ - "deno_core", - "deno_tls", - "log", - "serde", - "socket2", - "tokio", - "trust-dns-proto", - "trust-dns-resolver", -] - -[[package]] -name = "deno_ops" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e217fd2f9a61bc581f6b13868a46ef800efb7532348fd86cc4fe49204d203ea6" -dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2 1.0.66", - "quote 1.0.28", - "regex", - "syn 1.0.107", -] - -[[package]] -name = "deno_tls" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f604b5058cd533a00ec1f0dc9388bab42fb186912d789b6a9a8fd32af0d3a5" -dependencies = [ - "deno_core", - "once_cell", - "rustls", - "rustls-native-certs", - "rustls-pemfile", - "serde", - "webpki", - "webpki-roots", -] - -[[package]] -name = "deno_url" -version = "0.64.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a28c85d6e691a15cd8718c44c830a69d5a6c26d201f87d561a2bb63fe599cb" -dependencies = [ - "deno_core", - "serde", - "serde_repr", - "urlpattern", -] - -[[package]] -name = "deno_web" -version = "0.95.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ec62364ab724b3703e95482bf8172212cb1d2f86e7f18f41b0fefe3b8a8fddc" -dependencies = [ - "async-trait", - "base64-simd", - "deno_core", - "encoding_rs", - "flate2", - "serde", - "tokio", - "uuid", -] - -[[package]] -name = "deno_webidl" -version = "0.64.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c18838dcee75d21247e1235c81b457f4a1721602ca527bbfae2baff6e61dd2f" -dependencies = [ - "deno_core", -] - -[[package]] -name = "deno_websocket" -version = "0.69.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909f4e8ec64d88f0414488553cd83615048c13b0958699b025404c2abaf07893" -dependencies = [ - "deno_core", - "deno_tls", - "http", - "hyper", - "serde", - "tokio", - "tokio-rustls", - "tokio-tungstenite", -] - -[[package]] -name = "deno_webstorage" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252f9c272c371e2bc3fc7578a6ba1ba21fb6f70139a7281a044d6e4869a05e88" -dependencies = [ - "deno_core", - "deno_web", - "rusqlite", - "serde", -] - -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2 1.0.66", - "quote 1.0.28", - "rustc_version 0.4.0", - "syn 1.0.107", -] - -[[package]] -name = "devise" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6eacefd3f541c66fc61433d65e54e0e46e0a029a819a7dbbc7a7b489e8a85f8" -dependencies = [ - "devise_codegen", - "devise_core", -] - -[[package]] -name = "devise_codegen" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" -dependencies = [ - "devise_core", - "quote 1.0.28", -] - -[[package]] -name = "devise_core" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" -dependencies = [ - "bitflags 2.3.1", - "proc-macro2 1.0.66", - "proc-macro2-diagnostics 0.10.0", - "quote 1.0.28", - "syn 2.0.28", -] - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.6", -] - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer 0.10.3", - "crypto-common", - "subtle 2.4.1", + "block-buffer 0.10.3", + "crypto-common", + "subtle 2.4.1", ] [[package]] @@ -2075,29 +1469,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" -[[package]] -name = "dlopen" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" -dependencies = [ - "dlopen_derive", - "lazy_static", - "libc", - "winapi", -] - -[[package]] -name = "dlopen_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" -dependencies = [ - "libc", - "quote 0.6.13", - "syn 0.15.44", -] - [[package]] name = "dprint-core" version = "0.58.3" @@ -2186,18 +1557,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", -] - [[package]] name = "ed25519-dalek" version = "1.0.0-pre.3" @@ -2217,28 +1576,6 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct", - "crypto-bigint", - "der", - "digest 0.10.6", - "ff", - "generic-array 0.14.6", - "group", - "hkdf", - "pem-rfc7468", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "encode_unicode" version = "1.0.0" @@ -2260,18 +1597,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "enum-as-inner" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" -dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.66", - "quote 1.0.28", - "syn 1.0.107", -] - [[package]] name = "enum_kind" version = "0.2.1" @@ -2279,7 +1604,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b940da354ae81ef0926c5eaa428207b8f4f091d3956c891dfbd124162bed99" dependencies = [ "pmutil", - "proc-macro2 1.0.66", + "proc-macro2", "swc_macros_common", "syn 1.0.107", ] @@ -2397,16 +1722,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle 2.4.1", -] - [[package]] name = "figment" version = "0.10.8" @@ -2433,33 +1748,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fly-accept-encoding" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3afa7516fdcfd8e5e93a938f8fec857785ced190a1f62d842d1fe1ffbe22ba8" -dependencies = [ - "http", - "itertools", - "thiserror", -] - [[package]] name = "fnv" version = "1.0.7" @@ -2482,7 +1770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0981e470d2ab9f643df3921d54f1952ea100c39fdb6a3fdc820e20d2291df6c" dependencies = [ "pmutil", - "proc-macro2 1.0.66", + "proc-macro2", "swc_macros_common", "syn 1.0.107", ] @@ -2498,44 +1786,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fsevent" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8836d1f147a0a195bf517a5fd211ea7023d19ced903135faf6c4504f2cf8775f" -dependencies = [ - "bitflags 1.3.2", - "fsevent-sys 4.1.0", -] - -[[package]] -name = "fsevent-sys" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6f5e6817058771c10f0eb0f05ddf1e35844266f972004fe8e4b21fda295bd5" -dependencies = [ - "libc", -] - -[[package]] -name = "fsevent-sys" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" -dependencies = [ - "libc", -] - -[[package]] -name = "fslock" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57eafdd0c16f57161105ae1b98a1238f97645f2f588438b2949c99a2af9616bf" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "futures" version = "0.3.26" @@ -2590,8 +1840,8 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -2700,16 +1950,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug 0.3.0", - "polyval", -] - [[package]] name = "gimli" version = "0.27.1" @@ -2735,17 +1975,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle 2.4.1", -] - [[package]] name = "h2" version = "0.3.18" @@ -2897,15 +2126,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "hkdf" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" -dependencies = [ - "hmac 0.12.1", -] - [[package]] name = "hmac" version = "0.7.1" @@ -2957,17 +2177,6 @@ dependencies = [ "hmac 0.8.1", ] -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - [[package]] name = "http" version = "0.2.8" @@ -3088,17 +2297,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.3.0" @@ -3109,12 +2307,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "if_chain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" - [[package]] name = "import_map" version = "0.12.1" @@ -3155,36 +2347,6 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" -[[package]] -name = "inotify" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" -dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "block-padding 0.3.2", - "generic-array 0.14.6", -] - [[package]] name = "instant" version = "0.1.12" @@ -3213,18 +2375,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "ipconfig" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" -dependencies = [ - "socket2", - "widestring", - "winapi", - "winreg", -] - [[package]] name = "ipnet" version = "2.7.1" @@ -3239,8 +2389,8 @@ checksum = "8a7d079e129b77477a49c5c4f1cfe9ce6c2c909ef52520693e8e811a714c7b20" dependencies = [ "Inflector", "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -3256,30 +2406,12 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.61" @@ -3336,9 +2468,6 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] [[package]] name = "lexical" @@ -3427,13 +2556,7 @@ checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ "cfg-if", "winapi", -] - -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +] [[package]] name = "libsecp256k1" @@ -3614,15 +2737,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "lsp-types" version = "0.94.0" @@ -3636,15 +2750,6 @@ dependencies = [ "url", ] -[[package]] -name = "lzzzz" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8014d1362004776e6a91e4c15a3aa7830d1b6650a075b51a9969ebb6d6af13bc" -dependencies = [ - "cc", -] - [[package]] name = "mac_address" version = "1.1.4" @@ -3655,12 +2760,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matchers" version = "0.1.0" @@ -3809,7 +2908,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "987f12c91eb6ce0b67819f7c5fb4d391de64cf411c605ed027f03507a33943b2" dependencies = [ - "quote 1.0.28", + "quote", "syn 1.0.107", ] @@ -3886,43 +2985,12 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "node_resolver" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1012fcb4f5cc14c272731f4baf6ba8a2d40c650908f4d2531f7ed17f214e5ae" -dependencies = [ - "anyhow", - "path-clean", - "serde", - "serde_json", -] - [[package]] name = "nodrop" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" -[[package]] -name = "notify" -version = "5.0.0-pre.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebe7699a0f8c5759450716ee03d231685c22b4fe8f406c42c22e0ad94d40ce7" -dependencies = [ - "anymap", - "bitflags 1.3.2", - "crossbeam-channel", - "filetime", - "fsevent", - "fsevent-sys 3.1.0", - "inotify", - "libc", - "mio 0.7.14", - "walkdir", - "winapi", -] - [[package]] name = "ntapi" version = "0.3.7" @@ -3967,23 +3035,6 @@ dependencies = [ "serde", ] -[[package]] -name = "num-bigint-dig" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2399c9463abc5f909349d8aa9ba080e0b88b3ce2885389b60b993f39b1a56905" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.5", - "smallvec 1.10.0", - "zeroize", -] - [[package]] name = "num-complex" version = "0.2.4" @@ -4033,7 +3084,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -4082,12 +3132,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - [[package]] name = "os_pipe" version = "1.1.3" @@ -4116,28 +3160,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2 0.10.6", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2 0.10.6", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -4197,18 +3219,6 @@ dependencies = [ "subtle 2.4.1", ] -[[package]] -name = "path-clean" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - [[package]] name = "pbkdf2" version = "0.11.0" @@ -4238,21 +3248,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2", "proc-macro2-diagnostics 0.9.1", - "quote 1.0.28", + "quote", "syn 1.0.107", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.2.0" @@ -4269,27 +3270,6 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "petgraph" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" -dependencies = [ - "fixedbitset", - "indexmap 1.9.2", -] - -[[package]] -name = "phf" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" -dependencies = [ - "phf_macros", - "phf_shared", - "proc-macro-hack", -] - [[package]] name = "phf_generator" version = "0.10.0" @@ -4300,20 +3280,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "phf_macros" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro-hack", - "proc-macro2 1.0.66", - "quote 1.0.28", - "syn 1.0.107", -] - [[package]] name = "phf_shared" version = "0.10.0" @@ -4344,8 +3310,8 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -4361,28 +3327,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs1" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719" -dependencies = [ - "der", - "pkcs8", - "spki", - "zeroize", -] - -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der", - "spki", -] - [[package]] name = "pkg-config" version = "0.3.26" @@ -4395,23 +3339,11 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -4438,16 +3370,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -4455,8 +3377,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", "version_check", ] @@ -4467,8 +3389,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "version_check", ] @@ -4478,15 +3400,6 @@ version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.66" @@ -4502,8 +3415,8 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", "version_check", "yansi", @@ -4515,8 +3428,8 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 2.0.28", "version_check", "yansi", @@ -4542,36 +3455,15 @@ dependencies = [ "unicase", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2", ] -[[package]] -name = "radix_fmt" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce082a9940a7ace2ad4a8b7d0b1eac6aa378895f18be598230c5f2284ac05426" - [[package]] name = "radix_trie" version = "0.2.1" @@ -4694,8 +3586,8 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c501201393982e275433bc55de7d6ae6f00e7699cd5572c5b57581cd69c881b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -4725,12 +3617,6 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "relative-path" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf2521270932c3c7bed1a59151222bd7643c79310f2916f01925e1e16255698" - [[package]] name = "remove_dir_all" version = "0.5.3" @@ -4746,7 +3632,6 @@ version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ - "async-compression", "base64 0.21.3", "bytes", "encoding_rs", @@ -4771,44 +3656,15 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-rustls", - "tokio-util 0.7.7", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", "webpki-roots", "winreg", ] -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", -] - -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "ring" version = "0.16.20" @@ -4892,11 +3748,11 @@ dependencies = [ "devise", "glob", "indexmap 1.9.2", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "rocket_http", "syn 2.0.28", - "unicode-xid 0.2.4", + "unicode-xid", ] [[package]] @@ -4926,26 +3782,6 @@ dependencies = [ "uncased", ] -[[package]] -name = "rsa" -version = "0.7.0-pre" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6168b9a0f38e487db90dc109ad6d8f37fc5590183b7bfe8d8687e0b86116d53f" -dependencies = [ - "byteorder", - "digest 0.10.6", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core 0.6.4", - "smallvec 1.10.0", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "rstest" version = "0.11.0" @@ -4953,8 +3789,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2288c66aeafe3b2ed227c981f364f9968fa952ef0b30e84ada4486e7ee24d00a" dependencies = [ "cfg-if", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "rustc_version 0.4.0", "syn 1.0.107", ] @@ -4965,7 +3801,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32c6cfaae58c048728261723a72b80a0aa9f3768e9a7da3b302a24d262525219" dependencies = [ - "quote 1.0.28", + "quote", "rustc_version 0.3.3", "syn 1.0.107", ] @@ -5051,18 +3887,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - [[package]] name = "rustls-pemfile" version = "1.0.2" @@ -5108,24 +3932,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" -dependencies = [ - "windows-sys 0.42.0", -] - [[package]] name = "schemars" version = "0.8.11" @@ -5144,8 +3950,8 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "serde_derive_internals", "syn 1.0.107", ] @@ -5178,20 +3984,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct", - "der", - "generic-array 0.14.6", - "pkcs8", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "secp256k1" version = "0.24.3" @@ -5212,29 +4004,6 @@ dependencies = [ "cc", ] -[[package]] -name = "security-framework" -version = "2.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "segment" version = "0.1.2" @@ -5308,17 +4077,6 @@ dependencies = [ "smallvec 0.6.14", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde-wasm-bindgen" version = "0.6.0" @@ -5327,16 +4085,7 @@ checksum = "30c9933e5689bd420dc6c87b7a1835701810cbc10cd86a26e4da45b73e6b1d78" dependencies = [ "js-sys", "serde", - "wasm-bindgen", -] - -[[package]] -name = "serde_bytes" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" -dependencies = [ - "serde", + "wasm-bindgen", ] [[package]] @@ -5355,8 +4104,8 @@ version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 2.0.28", ] @@ -5366,8 +4115,8 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -5389,8 +4138,8 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -5416,20 +4165,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_v8" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c3efa9cff97d5a543df0508c37af619e422fb92eb525f38d255d46df7a0eb7" -dependencies = [ - "bytes", - "derive_more", - "serde", - "serde_bytes", - "smallvec 1.10.0", - "v8", -] - [[package]] name = "serde_with" version = "1.14.0" @@ -5447,8 +4182,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ "darling", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -5464,30 +4199,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha-1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.6", -] - [[package]] name = "sha1" version = "0.6.1" @@ -5623,22 +4334,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.6", - "rand_core 0.6.4", -] - -[[package]] -name = "simd-abstraction" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2880f3f7b392823ee65bbcc681961cd8e698c6a30e91ab9b4eef1f9c6c226d8" - [[package]] name = "similar" version = "2.2.1" @@ -5749,22 +4444,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "sourcemap" -version = "6.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e031f2463ecbdd5f34c950f89f5c1e1032f22c0f8e3dc4bdb2e8b6658cf61eb" -dependencies = [ - "base64 0.11.0", - "if_chain", - "lazy_static", - "regex", - "rustc_version 0.2.3", - "serde", - "serde_json", - "url", -] - [[package]] name = "spin" version = "0.5.2" @@ -5777,16 +4456,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5d6e0250b93c8427a177b849d144a96d5acc57006149479403d7861ab721e34" -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der", -] - [[package]] name = "stable-pattern" version = "0.1.0" @@ -5959,8 +4628,8 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "serde", "serde_derive", "syn 1.0.107", @@ -5973,8 +4642,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "serde", "serde_derive", "serde_json", @@ -6016,8 +4685,8 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ "phf_generator", "phf_shared", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", ] [[package]] @@ -6027,8 +4696,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41491e23e7db79343236a6ced96325ff132eb09e29ac4c5b8132b9c55aaaae89" dependencies = [ "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "swc_macros_common", "syn 1.0.107", ] @@ -6055,8 +4724,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "rustversion", "syn 1.0.107", ] @@ -6087,345 +4756,66 @@ dependencies = [ ] [[package]] -name = "swc_bundler" -version = "0.169.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd675a730040ce147232e7021aebebfbe16098079824763578cd6b597632ccc" -dependencies = [ - "ahash", - "anyhow", - "crc", - "indexmap 1.9.2", - "is-macro", - "once_cell", - "parking_lot 0.12.1", - "petgraph", - "radix_fmt", - "relative-path", - "retain_mut", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_optimization", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_fast_graph", - "swc_graph_analyzer", - "tracing", -] - -[[package]] -name = "swc_common" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e76a324fa0d7240e790c78914f39fdecfa9d87ef4efed591124b58607a4a4a" -dependencies = [ - "ahash", - "ast_node", - "better_scoped_tls", - "cfg-if", - "debug_unreachable", - "either", - "from_variant", - "num-bigint", - "once_cell", - "rustc-hash", - "serde", - "siphasher", - "sourcemap", - "string_cache", - "swc_atoms", - "swc_eq_ignore_macros", - "swc_visit", - "tracing", - "unicode-width", - "url", -] - -[[package]] -name = "swc_config" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4de36224eb9498fccd4e68971f0b83326ccf8592c2d424f257f3a1c76b2b211" -dependencies = [ - "indexmap 1.9.2", - "serde", - "serde_json", - "swc_config_macro", -] - -[[package]] -name = "swc_config_macro" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb64bc03d90fd5c90d6ab917bb2b1d7fbd31957df39e31ea24a3f554b4372251" -dependencies = [ - "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", - "swc_macros_common", - "syn 1.0.107", -] - -[[package]] -name = "swc_ecma_ast" -version = "0.84.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce1fb31e3a100feb31f94647fe27e457bc13b17a8931204fdc9bc58a15c936a" -dependencies = [ - "bitflags 1.3.2", - "is-macro", - "num-bigint", - "scoped-tls", - "serde", - "string_enum", - "swc_atoms", - "swc_common", - "unicode-id", -] - -[[package]] -name = "swc_ecma_codegen" -version = "0.115.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09abf1639f76d3d174225fdb608805f9c21d4c455f4dd2ef6ab156701f1f82a" -dependencies = [ - "memchr", - "num-bigint", - "once_cell", - "rustc-hash", - "sourcemap", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen_macros", - "tracing", -] - -[[package]] -name = "swc_ecma_codegen_macros" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0159c99f81f52e48fe692ef7af1b0990b45d3006b14c6629be0b1ffee1b23aea" -dependencies = [ - "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", - "swc_macros_common", - "syn 1.0.107", -] - -[[package]] -name = "swc_ecma_dep_graph" -version = "0.83.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832d9690a915f50c6dd86d107c9c9ec37b3d8dab59ed45814ba7bc63e0aa5a87" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_loader" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710c86eb2b253160d4a02fa77057f1c493b3932d1b83430cbbc1e7823eb47e8c" -dependencies = [ - "ahash", - "anyhow", - "pathdiff", - "serde", - "swc_common", - "tracing", -] - -[[package]] -name = "swc_ecma_parser" -version = "0.111.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1766e5b969c59e51a5dfe9337755d7380a891e579dd6b0eb7816587c7ea7aa" -dependencies = [ - "either", - "enum_kind", - "lexical", - "num-bigint", - "serde", - "smallvec 1.10.0", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "tracing", - "typed-arena", -] - -[[package]] -name = "swc_ecma_transforms_base" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b316a99dde0ef85f1878aaa9f4bf9b15f16e999c56ed31a1433928c754ae4e" -dependencies = [ - "better_scoped_tls", - "bitflags 1.3.2", - "num_cpus", - "once_cell", - "phf", - "rustc-hash", - "serde", - "smallvec 1.10.0", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_utils", - "swc_ecma_visit", - "tracing", -] - -[[package]] -name = "swc_ecma_transforms_classes" -version = "0.85.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c853c4366e81092d38b746e71adffc1150c694f02c1068c9fa24abbdc373a65f" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf907935ec5492256b523ae7935a824d9fdc0368dcadc41375bad0dca91cd8b" -dependencies = [ - "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", - "swc_macros_common", - "syn 1.0.107", -] - -[[package]] -name = "swc_ecma_transforms_optimization" -version = "0.144.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9413ed145b0c3e693d18760a72c72bb7ac3e522edbb88bfe0c6c161a7b148281" -dependencies = [ - "ahash", - "dashmap", - "indexmap 1.9.2", - "once_cell", - "rustc-hash", - "serde_json", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", - "tracing", -] - -[[package]] -name = "swc_ecma_transforms_proposal" -version = "0.122.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ebc6e03a51f9adcbc40ec144c9bbe78de872bf6f8f581f3abd51187ec6e648" -dependencies = [ - "either", - "serde", - "smallvec 1.10.0", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_react" -version = "0.133.0" +name = "swc_common" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b0516e231008722175bc0841bf4f3fdcfd3276ca0bf4878d6e87af5c50f324" +checksum = "68e76a324fa0d7240e790c78914f39fdecfa9d87ef4efed591124b58607a4a4a" dependencies = [ "ahash", - "base64 0.13.1", - "dashmap", - "indexmap 1.9.2", + "ast_node", + "better_scoped_tls", + "cfg-if", + "debug_unreachable", + "either", + "from_variant", + "num-bigint", "once_cell", - "regex", + "rustc-hash", "serde", - "sha-1 0.10.1", - "string_enum", + "siphasher", + "string_cache", "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", + "swc_eq_ignore_macros", + "swc_visit", + "tracing", + "unicode-width", + "url", ] [[package]] -name = "swc_ecma_transforms_typescript" -version = "0.137.0" +name = "swc_ecma_ast" +version = "0.84.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6716a73401b5d717d6fd20159385ce09adbdd3afc765c3890859d84ada8af729" +checksum = "cce1fb31e3a100feb31f94647fe27e457bc13b17a8931204fdc9bc58a15c936a" dependencies = [ + "bitflags 1.3.2", + "is-macro", + "num-bigint", + "scoped-tls", "serde", + "string_enum", "swc_atoms", "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_react", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_utils" -version = "0.93.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70981d5ef10c0ff0a002e21decbca9dde5b40c2fc0d0bc6eaebb219a8e0a5f7d" -dependencies = [ - "indexmap 1.9.2", - "once_cell", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", - "tracing", "unicode-id", ] [[package]] -name = "swc_ecma_visit" -version = "0.70.0" +name = "swc_ecma_parser" +version = "0.111.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcd081250d664808fcd23110202728811236c87f527656ffc1db7f00ac1a06dd" +checksum = "cc1766e5b969c59e51a5dfe9337755d7380a891e579dd6b0eb7816587c7ea7aa" dependencies = [ + "either", + "enum_kind", + "lexical", "num-bigint", + "serde", + "smallvec 1.10.0", "swc_atoms", "swc_common", "swc_ecma_ast", - "swc_visit", "tracing", + "typed-arena", ] [[package]] @@ -6435,36 +4825,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c20468634668c2bbab581947bb8c75c97158d5a6959f4ba33df20983b20b4f6" dependencies = [ "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] -[[package]] -name = "swc_fast_graph" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9260826bb82481fb946ca653d10196f2653beba1b566b72f42ba7046e4ad0c8f" -dependencies = [ - "ahash", - "indexmap 1.9.2", - "petgraph", - "swc_common", -] - -[[package]] -name = "swc_graph_analyzer" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b192a3b556cf0a81b4dcb8fa35374d306cd46f806dce937599b40e2d945e51" -dependencies = [ - "ahash", - "auto_impl 0.5.0", - "petgraph", - "swc_fast_graph", - "tracing", -] - [[package]] name = "swc_macros_common" version = "0.3.6" @@ -6472,8 +4837,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4be988307882648d9bc7c71a6a73322b7520ef0211e920489a98f8391d8caa2" dependencies = [ "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -6495,31 +4860,20 @@ checksum = "cad1b8e0b2d48660bc454f70495e9bb583f9bf501f28165568569946e62f44a2" dependencies = [ "Inflector", "pmutil", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "swc_macros_common", "syn 1.0.107", ] -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "unicode-ident", ] @@ -6529,8 +4883,8 @@ version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "unicode-ident", ] @@ -6620,8 +4974,8 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -6716,8 +5070,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" dependencies = [ "proc-macro-hack", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "standback", "syn 1.0.107", ] @@ -6776,8 +5130,8 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -6803,22 +5157,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e80b39df6afcc12cdf752398ade96a6b9e99c903dfdc36e53ad10b9c366bca72" -dependencies = [ - "futures-util", - "log", - "rustls", - "tokio", - "tokio-rustls", - "tungstenite", - "webpki", - "webpki-roots", -] - [[package]] name = "tokio-util" version = "0.6.10" @@ -6863,23 +5201,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" - -[[package]] -name = "toml_edit" -version = "0.19.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" -dependencies = [ - "indexmap 2.0.0", - "toml_datetime", - "winnow", -] - [[package]] name = "tower" version = "0.4.13" @@ -6907,7 +5228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b38fb0e6ce037835174256518aace3ca621c4f96383c56bb846cfc11b341910" dependencies = [ "async-trait", - "auto_impl 1.0.1", + "auto_impl", "bytes", "dashmap", "futures", @@ -6929,8 +5250,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34723c06344244474fdde365b76aebef8050bf6be61a935b91ee9ff7c4e91157" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -6969,8 +5290,8 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", ] @@ -7013,53 +5334,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "trust-dns-proto" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "log", - "rand 0.8.5", - "serde", - "smallvec 1.10.0", - "thiserror", - "tinyvec", - "tokio", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot 0.12.1", - "resolv-conf", - "serde", - "smallvec 1.10.0", - "thiserror", - "tokio", - "trust-dns-proto", -] - [[package]] name = "try-lock" version = "0.2.4" @@ -7079,27 +5353,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "tungstenite" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "rand 0.8.5", - "rustls", - "sha-1 0.9.8", - "thiserror", - "url", - "utf-8", - "webpki", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -7107,7 +5360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.7.3", + "rand 0.8.5", "static_assertions", ] @@ -7148,47 +5401,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-ucd-ident" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - [[package]] name = "unicase" version = "2.6.0" @@ -7237,28 +5449,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array 0.14.6", - "subtle 2.4.1", -] - [[package]] name = "unreachable" version = "0.1.1" @@ -7281,30 +5477,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna", "percent-encoding", "serde", ] -[[package]] -name = "urlpattern" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9bd5ff03aea02fa45b13a7980151fe45009af1980ba69f651ec367121a31609" -dependencies = [ - "derive_more", - "regex", - "serde", - "unic-ucd-ident", - "url", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8parse" version = "0.2.1" @@ -7321,19 +5498,6 @@ dependencies = [ "serde", ] -[[package]] -name = "v8" -version = "0.47.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be156dece7a023d5959a72dc0d398d6c95100ec601a2cea10d868da143e85166" -dependencies = [ - "bitflags 1.3.2", - "fslock", - "lazy_static", - "libc", - "which", -] - [[package]] name = "valuable" version = "0.1.0" @@ -7364,17 +5528,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - [[package]] name = "want" version = "0.3.0" @@ -7422,8 +5575,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", "wasm-bindgen-shared", ] @@ -7446,7 +5599,7 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ - "quote 1.0.28", + "quote", "wasm-bindgen-macro-support", ] @@ -7456,8 +5609,8 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.28", + "proc-macro2", + "quote", "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -7469,19 +5622,6 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" -[[package]] -name = "wasm-streams" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "web-sys" version = "0.3.61" @@ -7511,23 +5651,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "widestring" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" - [[package]] name = "winapi" version = "0.3.9" @@ -7715,15 +5838,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" -[[package]] -name = "winnow" -version = "0.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.10.1" @@ -7733,15 +5847,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "winres" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" -dependencies = [ - "toml 0.5.11", -] - [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index ab7e9eb01..098185b39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "components/clarinet-cli", "components/clarinet-deployments", diff --git a/components/clarinet-cli/Cargo.toml b/components/clarinet-cli/Cargo.toml index ae5ee7db3..c0b2985b4 100644 --- a/components/clarinet-cli/Cargo.toml +++ b/components/clarinet-cli/Cargo.toml @@ -16,68 +16,16 @@ categories = [ "development-tools::build-utils", ] -[target.'cfg(windows)'.build-dependencies] -winapi = "0.3.9" -winres = "0.1.11" - -[build-dependencies] -deno_broadcast_channel = { version = "0.58.0" } -deno_console = { version = "0.64.0" } -deno_core = { version = "0.146.0" } -deno_crypto = { version = "0.78.0" } -deno_fetch = { version = "0.87.0" } -deno_net = { version = "0.56.0" } -deno_url = { version = "0.64.0" } -deno_web = { version = "0.95.0" } -deno_websocket = { version = "0.69.0" } -deno_webstorage = { version = "0.59.0" } -deno_webidl = { version = "0.64.0" } -deno_tls = { version = "0.51.0" } -deno_http = { version = "0.58.0" } -regex = "1.7" -serde = { version = "1.0.136", features = ["derive"] } -lzzzz = '1.0' - [dependencies] +ansi_term = "0.12.1" clap = { version = "3.2.23", features = ["derive"], optional = true } clap_generate = { version = "3.0.3", optional = true } toml = { version = "0.5.6", features = ["preserve_order"] } serde = { version = "1.0.136", features = ["derive"] } serde_json = { version = "1.0.79", features = ["preserve_order"] } serde_derive = "1" -deno_emit = { version = "0.4.0", optional = true } -deno_graph = { version = "0.29.0", optional = true } -deno_core = { version = "0.146.0", optional = true } -deno_ast = { version = "0.17.0", features = ["cjs"], optional = true } -deno_tls = { version = "0.51.0", optional = true } -deno_web = { version = "0.95.0", optional = true } -deno_ops = { version = "0.24.0", optional = true } -deno_net = { version = "0.56.0", optional = true } -deno_url = { version = "0.64.0", optional = true } -lzzzz = '1.0' -### To eliminate -deno_console = { version = "0.64.0", optional = true } -deno_webstorage = { version = "0.59.0", optional = true } -deno_broadcast_channel = { version = "0.58.0", optional = true } -hyper = { version = "0.14.18", features = [ - "server", - "stream", - "http1", - "http2", - "runtime", -] } -http = "0.2.6" -### -rsa = "=0.7.0-pre" -deno_fetch = { version = "0.87.0", optional = true } -deno_crypto = { version = "0.78.0", optional = true } import_map = { version = "=0.12.1", optional = true } -once_cell = { version = "1.13.0", optional = true } -walkdir = { version = "=2.3.2", optional = true } -node_resolver = { version = "0.1.1", optional = true } cache_control = { version = "=0.2.0", optional = true } -notify = "=5.0.0-pre.7" -dlopen = { version = "0.1.8", optional = true } log = { version = "=0.4.17", features = ["serde"] } filetime = "0.2.16" env_logger = "=0.9.0" @@ -99,10 +47,6 @@ tokio-util = { version = "0.7.1", features = ["io"], optional = true } clarity_repl = { package = "clarity-repl", path = "../clarity-repl", features = [ "cli", ] } -aes = "0.7.5" -base64 = "0.13.0" -rand = "0.8.3" -ring = "0.16.20" libsecp256k1 = "0.7.0" uuid = { version = "=1.0.0", features = ["v4", "serde"] } hmac = "0.12.0" @@ -117,7 +61,6 @@ libc = "0.2.86" encoding_rs = "0.8.31" percent-encoding = "2.1.0" pin-project = "1.0.5" -indexmap = { version = "1.6.1", features = ["serde"] } reqwest = { version = "0.11", default-features = false, features = [ "blocking", "json", @@ -146,7 +89,6 @@ similar = "2.1.0" crossbeam-channel = "0.5.6" chrono = "0.4.20" sha2 = "0.10.0" -ansi_term = "0.12.1" [dependencies.tui] version = "0.18.0" @@ -191,26 +133,8 @@ path = "src/bin.rs" [features] default = ["cli", "telemetry"] cli = [ - "deno_emit", - "deno_graph", - "deno_core", - "deno_ast", - "deno_tls", - "deno_fetch", - "deno_web", - "deno_crypto", - "deno_ops", - "deno_net", - "deno_url", - "deno_console", - "deno_webstorage", - "deno_broadcast_channel", - "dlopen", "import_map", - "once_cell", - "node_resolver", "cache_control", - "walkdir", "tokio-util", "clap", "clap_generate", diff --git a/components/clarinet-cli/build.rs b/components/clarinet-cli/build.rs deleted file mode 100644 index 30562ed4c..000000000 --- a/components/clarinet-cli/build.rs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -use deno_core::Extension; -use deno_core::JsRuntime; -use deno_core::RuntimeOptions; -use std::env; -use std::path::Path; -use std::path::PathBuf; - -// TODO(bartlomieju): this module contains a lot of duplicated -// logic with `cli/build.rs`, factor out to `deno_core`. -fn create_snapshot(mut js_runtime: JsRuntime, snapshot_path: &Path, files: Vec) { - // TODO(nayeemrmn): https://github.com/rust-lang/cargo/issues/3946 to get the - // workspace root. - let display_root = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap(); - for file in files { - println!("cargo:rerun-if-changed={}", file.display()); - let display_path = file.strip_prefix(display_root).unwrap(); - let display_path_str = display_path.display().to_string(); - js_runtime - .execute_script( - &("deno:".to_string() + &display_path_str.replace('\\', "/")), - &std::fs::read_to_string(&file).unwrap(), - ) - .unwrap(); - } - - let snapshot = js_runtime.snapshot(); - let snapshot_slice: &[u8] = &*snapshot; - println!("Snapshot size: {}", snapshot_slice.len()); - - let compressed_snapshot_with_size = { - let mut vec = vec![]; - - vec.extend_from_slice( - &u32::try_from(snapshot.len()) - .expect("snapshot larger than 4gb") - .to_le_bytes(), - ); - - lzzzz::lz4_hc::compress_to_vec(snapshot_slice, &mut vec, lzzzz::lz4_hc::CLEVEL_MAX) - .expect("snapshot compression failed"); - - vec - }; - - println!( - "Snapshot compressed size: {}", - compressed_snapshot_with_size.len() - ); - - std::fs::write(&snapshot_path, compressed_snapshot_with_size).unwrap(); - println!("Snapshot written to: {} ", snapshot_path.display()); -} - -struct Permissions; - -impl deno_fetch::FetchPermissions for Permissions { - fn check_net_url( - &mut self, - _url: &deno_core::url::Url, - ) -> Result<(), deno_core::error::AnyError> { - unreachable!("snapshotting!") - } - - fn check_read(&mut self, _p: &Path) -> Result<(), deno_core::error::AnyError> { - unreachable!("snapshotting!") - } -} - -impl deno_websocket::WebSocketPermissions for Permissions { - fn check_net_url( - &mut self, - _url: &deno_core::url::Url, - ) -> Result<(), deno_core::error::AnyError> { - unreachable!("snapshotting!") - } -} - -impl deno_web::TimersPermission for Permissions { - fn allow_hrtime(&mut self) -> bool { - unreachable!("snapshotting!") - } - - fn check_unstable(&self, _state: &deno_core::OpState, _api_name: &'static str) { - unreachable!("snapshotting!") - } -} - -impl deno_net::NetPermissions for Permissions { - fn check_net>( - &mut self, - _host: &(T, Option), - ) -> Result<(), deno_core::error::AnyError> { - unreachable!("snapshotting!") - } - - fn check_read(&mut self, _p: &Path) -> Result<(), deno_core::error::AnyError> { - unreachable!("snapshotting!") - } - - fn check_write(&mut self, _p: &Path) -> Result<(), deno_core::error::AnyError> { - unreachable!("snapshotting!") - } -} - -fn create_runtime_snapshot(snapshot_path: &Path, files: Vec) { - let extensions: Vec = vec![ - deno_webidl::init(), - deno_console::init(), - deno_url::init(), - deno_tls::init(), - deno_web::init::(deno_web::BlobStore::default(), Default::default()), - deno_fetch::init::(Default::default()), - deno_websocket::init::("".to_owned(), None, None), - deno_webstorage::init(None), - deno_crypto::init(None), - deno_broadcast_channel::init( - deno_broadcast_channel::InMemoryBroadcastChannel::default(), - false, // No --unstable. - ), - deno_net::init::( - None, false, // No --unstable. - None, - ), - deno_http::init(), - ]; - - let js_runtime = JsRuntime::new(RuntimeOptions { - will_snapshot: true, - extensions, - ..Default::default() - }); - create_snapshot(js_runtime, snapshot_path, files); -} - -fn get_js_files(d: &str) -> Vec { - let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); - let mut js_files = std::fs::read_dir(d) - .unwrap() - .map(|dir_entry| { - let file = dir_entry.unwrap(); - manifest_dir.join(file.path()) - }) - .filter(|path| path.extension().unwrap_or_default() == "js") - .collect::>(); - js_files.sort(); - js_files -} - -pub fn build_snapshot(runtime_snapshot_path: PathBuf) { - let js_files = get_js_files("js"); - create_runtime_snapshot(&runtime_snapshot_path, js_files); -} - -fn git_commit_hash() -> String { - if let Ok(output) = std::process::Command::new("git") - .arg("rev-list") - .arg("-1") - .arg("HEAD") - .output() - { - if output.status.success() { - std::str::from_utf8(&output.stdout[..40]) - .unwrap() - .to_string() - } else { - // When not in git repository - // (e.g. when the user install by `cargo install deno`) - "UNKNOWN".to_string() - } - } else { - // When there is no git command for some reason - "UNKNOWN".to_string() - } -} - -fn main() { - // To debug snapshot issues uncomment: - // op_fetch_asset::trace_serializer(); - - println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap()); - println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap()); - println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_commit_hash()); - println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH"); - println!("cargo:rustc-env=TS_VERSION=4.3.0"); - println!("cargo:rerun-if-env-changed=TS_VERSION"); - - let o = PathBuf::from(env::var_os("OUT_DIR").unwrap()); - - // Main snapshot - let runtime_snapshot_path = o.join("CLI_SNAPSHOT.bin"); - - build_snapshot(runtime_snapshot_path) -} diff --git a/components/clarinet-cli/dts/README.md b/components/clarinet-cli/dts/README.md deleted file mode 100644 index 9d07188f7..000000000 --- a/components/clarinet-cli/dts/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# How to upgrade TypeScript. - -The files in this directory are mostly from the TypeScript repository. We -currently (unfortunately) have a rather manual process for upgrading TypeScript. -It works like this currently: - -1. Checkout typescript repo in a separate directory. -2. Copy typescript.js into Deno repo. -3. Copy d.ts files into dts directory. - -So that might look something like this: - -``` -git clone https://github.com/microsoft/TypeScript.git -cd typescript -git checkout v3.9.7 -rsync lib/typescript.js ~/src/deno/cli/tsc/00_typescript.js -rsync --exclude=protocol.d.ts --exclude=tsserverlibrary.d.ts --exclude=typescriptServices.d.ts lib/*.d.ts ~/src/deno/cli/dts/ -``` diff --git a/components/clarinet-cli/dts/lib.d.ts b/components/clarinet-cli/dts/lib.d.ts deleted file mode 100644 index 9152c4dfc..000000000 --- a/components/clarinet-cli/dts/lib.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - - -/// - - -/// -/// -/// -/// diff --git a/components/clarinet-cli/dts/lib.deno.ns.d.ts b/components/clarinet-cli/dts/lib.deno.ns.d.ts deleted file mode 100644 index e5499c93e..000000000 --- a/components/clarinet-cli/dts/lib.deno.ns.d.ts +++ /dev/null @@ -1,3109 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -/// -/// -/// - -/** Deno provides extra properties on `import.meta`. These are included here - * to ensure that these are still available when using the Deno namespace in - * conjunction with other type libs, like `dom`. */ -declare interface ImportMeta { - /** A string representation of the fully qualified module URL. */ - url: string; - - /** A flag that indicates if the current module is the main module that was - * called when starting the program under Deno. - * - * ```ts - * if (import.meta.main) { - * // this was loaded as the main module, maybe do some bootstrapping - * } - * ``` - */ - 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) - * which is not widely supported yet in other runtimes. These types are here - * so that these features are still available when using the Deno namespace - * in conjunction with other type libs, like `dom`. */ -declare interface Performance { - /** Stores a timestamp with the associated name (a "mark"). */ - mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark; - - /** Stores the `DOMHighResTimeStamp` duration between two marks along with the - * associated name (a "measure"). */ - measure( - measureName: string, - options?: PerformanceMeasureOptions, - ): PerformanceMeasure; -} - -declare interface PerformanceMarkOptions { - /** Metadata to be included in the mark. */ - // deno-lint-ignore no-explicit-any - detail?: any; - - /** Timestamp to be used as the mark time. */ - startTime?: number; -} - -declare interface PerformanceMeasureOptions { - /** Metadata to be included in the measure. */ - // deno-lint-ignore no-explicit-any - detail?: any; - - /** Timestamp to be used as the start time or string to be used as start - * mark. */ - start?: string | number; - - /** Duration between the start and end times. */ - duration?: number; - - /** Timestamp to be used as the end time or string to be used as end mark. */ - end?: string | number; -} - -declare namespace Deno { - /** A set of error constructors that are raised by Deno APIs. */ - export namespace errors { - export class NotFound extends Error {} - export class PermissionDenied extends Error {} - export class ConnectionRefused extends Error {} - export class ConnectionReset extends Error {} - export class ConnectionAborted extends Error {} - export class NotConnected extends Error {} - export class AddrInUse extends Error {} - export class AddrNotAvailable extends Error {} - export class BrokenPipe extends Error {} - export class AlreadyExists extends Error {} - export class InvalidData extends Error {} - export class TimedOut extends Error {} - export class Interrupted extends Error {} - export class WriteZero extends Error {} - export class UnexpectedEof extends Error {} - export class BadResource extends Error {} - export class Http extends Error {} - export class Busy extends Error {} - export class NotSupported extends Error {} - } - - /** The current process id of the runtime. */ - export const pid: number; - - /** - * The pid of the current process's parent. - */ - export const ppid: number; - - export interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - } - - /** - * Returns an object describing the memory usage of the Deno process measured - * in bytes. - */ - export function memoryUsage(): MemoryUsage; - - /** Reflects the `NO_COLOR` environment variable at program start. - * - * See: https://no-color.org/ */ - export const noColor: boolean; - - export type PermissionOptions = "inherit" | "none" | PermissionOptionsObject; - - export interface PermissionOptionsObject { - /** Specifies if the `env` permission should be requested or revoked. - * If set to `"inherit"`, the current `env` permission will be inherited. - * If set to `true`, the global `env` permission will be requested. - * If set to `false`, the global `env` permission will be revoked. - * - * Defaults to `false`. - */ - env?: "inherit" | boolean | string[]; - - /** Specifies if the `hrtime` permission should be requested or revoked. - * If set to `"inherit"`, the current `hrtime` permission will be inherited. - * If set to `true`, the global `hrtime` permission will be requested. - * If set to `false`, the global `hrtime` permission will be revoked. - * - * Defaults to `false`. - */ - hrtime?: "inherit" | boolean; - - /** Specifies if the `net` permission should be requested or revoked. - * if set to `"inherit"`, the current `net` permission will be inherited. - * if set to `true`, the global `net` permission will be requested. - * if set to `false`, the global `net` permission will be revoked. - * if set to `string[]`, the `net` permission will be requested with the - * specified host strings with the format `"[:]`. - * - * Defaults to `false`. - * - * Examples: - * - * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test({ - * name: "inherit", - * permissions: { - * net: "inherit", - * }, - * async fn() { - * const status = await Deno.permissions.query({ name: "net" }) - * assertEquals(status.state, "granted"); - * }, - * }); - * ``` - * - * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test({ - * name: "true", - * permissions: { - * net: true, - * }, - * async fn() { - * const status = await Deno.permissions.query({ name: "net" }); - * assertEquals(status.state, "granted"); - * }, - * }); - * ``` - * - * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test({ - * name: "false", - * permissions: { - * net: false, - * }, - * async fn() { - * const status = await Deno.permissions.query({ name: "net" }); - * assertEquals(status.state, "denied"); - * }, - * }); - * ``` - * - * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test({ - * name: "localhost:8080", - * permissions: { - * net: ["localhost:8080"], - * }, - * async fn() { - * const status = await Deno.permissions.query({ name: "net", host: "localhost:8080" }); - * assertEquals(status.state, "granted"); - * }, - * }); - * ``` - */ - net?: "inherit" | boolean | string[]; - - /** Specifies if the `ffi` permission should be requested or revoked. - * If set to `"inherit"`, the current `ffi` permission will be inherited. - * If set to `true`, the global `ffi` permission will be requested. - * If set to `false`, the global `ffi` permission will be revoked. - * - * Defaults to `false`. - */ - ffi?: "inherit" | boolean | Array; - - /** Specifies if the `read` permission should be requested or revoked. - * If set to `"inherit"`, the current `read` permission will be inherited. - * If set to `true`, the global `read` permission will be requested. - * If set to `false`, the global `read` permission will be revoked. - * If set to `Array`, the `read` permission will be requested with the - * specified file paths. - * - * Defaults to `false`. - */ - read?: "inherit" | boolean | Array; - - /** Specifies if the `run` permission should be requested or revoked. - * If set to `"inherit"`, the current `run` permission will be inherited. - * If set to `true`, the global `run` permission will be requested. - * If set to `false`, the global `run` permission will be revoked. - * - * Defaults to `false`. - */ - run?: "inherit" | boolean | Array; - - /** Specifies if the `write` permission should be requested or revoked. - * If set to `"inherit"`, the current `write` permission will be inherited. - * If set to `true`, the global `write` permission will be requested. - * If set to `false`, the global `write` permission will be revoked. - * If set to `Array`, the `write` permission will be requested with the - * specified file paths. - * - * Defaults to `false`. - */ - write?: "inherit" | boolean | Array; - } - - export interface TestContext { - /** - * The current test name. - */ - name: string; - /** - * File Uri of the current test code. - */ - origin: string; - /** - * Parent test context. - */ - parent?: TestContext; - - /** Run a sub step of the parent test or step. Returns a promise - * that resolves to a boolean signifying if the step completed successfully. - * The returned promise never rejects unless the arguments are invalid. - * If the test was ignored the promise returns `false`. - */ - step(t: TestStepDefinition): Promise; - - /** Run a sub step of the parent test or step. Returns a promise - * that resolves to a boolean signifying if the step completed successfully. - * The returned promise never rejects unless the arguments are invalid. - * If the test was ignored the promise returns `false`. - */ - step( - name: string, - fn: (t: TestContext) => void | Promise, - ): Promise; - } - - export interface TestStepDefinition { - fn: (t: TestContext) => void | Promise; - /** - * The current test name. - */ - name: string; - ignore?: boolean; - /** Check that the number of async completed ops after the test step is the same - * as number of dispatched ops. Defaults to the parent test or step's value. */ - sanitizeOps?: boolean; - /** Ensure the test step does not "leak" resources - ie. the resource table - * after the test has exactly the same contents as before the test. Defaults - * to the parent test or step's value. */ - sanitizeResources?: boolean; - /** Ensure the test step does not prematurely cause the process to exit, - * for example via a call to `Deno.exit`. Defaults to the parent test or - * step's value. */ - sanitizeExit?: boolean; - } - - export interface TestDefinition { - fn: (t: TestContext) => void | Promise; - /** - * The current test name. - */ - name: string; - ignore?: boolean; - /** If at least one test has `only` set to true, only run tests that have - * `only` set to true and fail the test suite. */ - only?: boolean; - /** Check that the number of async completed ops after the test is the same - * as number of dispatched ops. Defaults to true. */ - sanitizeOps?: boolean; - /** Ensure the test case does not "leak" resources - ie. the resource table - * after the test has exactly the same contents as before the test. Defaults - * to true. */ - sanitizeResources?: boolean; - /** Ensure the test case does not prematurely cause the process to exit, - * for example via a call to `Deno.exit`. Defaults to true. */ - sanitizeExit?: boolean; - - /** Specifies the permissions that should be used to run the test. - * Set this to "inherit" to keep the calling thread's permissions. - * Set this to "none" to revoke all permissions. - * - * Defaults to "inherit". - */ - permissions?: PermissionOptions; - } - - /** Register a test which will be run when `deno test` is used on the command - * line and the containing module looks like a test module. - * `fn` can be async if required. - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test({ - * name: "example test", - * fn(): void { - * assertEquals("world", "world"); - * }, - * }); - * - * Deno.test({ - * name: "example ignored test", - * ignore: Deno.build.os === "windows", - * fn(): void { - * // This test is ignored only on Windows machines - * }, - * }); - * - * Deno.test({ - * name: "example async test", - * async fn() { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * } - * }); - * ``` - */ - export function test(t: TestDefinition): void; - - /** Register a test which will be run when `deno test` is used on the command - * line and the containing module looks like a test module. - * `fn` can be async if required. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test("My test description", (): void => { - * assertEquals("hello", "hello"); - * }); - * - * Deno.test("My async test description", async (): Promise => { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function test( - name: string, - fn: (t: TestContext) => void | Promise, - ): void; - - /** Register a test which will be run when `deno test` is used on the command - * line and the containing module looks like a test module. - * `fn` can be async if required. Declared function must have a name. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test(function myTestName(): void { - * assertEquals("hello", "hello"); - * }); - * - * Deno.test(async function myOtherTestName(): Promise { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function test(fn: (t: TestContext) => void | Promise): void; - - /** Register a test which will be run when `deno test` is used on the command - * line and the containing module looks like a test module. - * `fn` can be async if required. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test("My test description", { permissions: { read: true } }, (): void => { - * assertEquals("hello", "hello"); - * }); - * - * Deno.test("My async test description", { permissions: { read: false } }, async (): Promise => { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function test( - name: string, - options: Omit, - fn: (t: TestContext) => void | Promise, - ): void; - - /** Register a test which will be run when `deno test` is used on the command - * line and the containing module looks like a test module. - * `fn` can be async if required. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test({ name: "My test description", permissions: { read: true } }, (): void => { - * assertEquals("hello", "hello"); - * }); - * - * Deno.test({ name: "My async test description", permissions: { read: false } }, async (): Promise => { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function test( - options: Omit, - fn: (t: TestContext) => void | Promise, - ): void; - - /** Register a test which will be run when `deno test` is used on the command - * line and the containing module looks like a test module. - * `fn` can be async if required. Declared function must have a name. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.test({ permissions: { read: true } }, function myTestName(): void { - * assertEquals("hello", "hello"); - * }); - * - * Deno.test({ permissions: { read: false } }, async function myOtherTestName(): Promise { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function test( - options: Omit, - fn: (t: TestContext) => void | Promise, - ): void; - - /** Exit the Deno process with optional exit code. If no exit code is supplied - * then Deno will exit with return code of 0. - * - * In worker contexts this is an alias to `self.close();`. - * - * ```ts - * Deno.exit(5); - * ``` - */ - export function exit(code?: number): never; - - export const env: { - /** Retrieve the value of an environment variable. Returns `undefined` if that - * key doesn't exist. - * - * ```ts - * console.log(Deno.env.get("HOME")); // e.g. outputs "/home/alice" - * console.log(Deno.env.get("MADE_UP_VAR")); // outputs "undefined" - * ``` - * Requires `allow-env` permission. */ - get(key: string): string | undefined; - - /** Set the value of an environment variable. - * - * ```ts - * Deno.env.set("SOME_VAR", "Value"); - * Deno.env.get("SOME_VAR"); // outputs "Value" - * ``` - * - * Requires `allow-env` permission. */ - set(key: string, value: string): void; - - /** Delete the value of an environment variable. - * - * ```ts - * Deno.env.set("SOME_VAR", "Value"); - * Deno.env.delete("SOME_VAR"); // outputs "undefined" - * ``` - * - * Requires `allow-env` permission. */ - delete(key: string): void; - - /** Returns a snapshot of the environment variables at invocation. - * - * ```ts - * Deno.env.set("TEST_VAR", "A"); - * const myEnv = Deno.env.toObject(); - * console.log(myEnv.SHELL); - * Deno.env.set("TEST_VAR", "B"); - * console.log(myEnv.TEST_VAR); // outputs "A" - * ``` - * - * Requires `allow-env` permission. */ - toObject(): { [index: string]: string }; - }; - - /** - * Returns the path to the current deno executable. - * - * ```ts - * console.log(Deno.execPath()); // e.g. "/home/alice/.local/bin/deno" - * ``` - * - * Requires `allow-read` permission. - */ - export function execPath(): string; - - /** - * Change the current working directory to the specified path. - * - * ```ts - * Deno.chdir("/home/userA"); - * Deno.chdir("../userB"); - * Deno.chdir("C:\\Program Files (x86)\\Java"); - * ``` - * - * Throws `Deno.errors.NotFound` if directory not found. - * Throws `Deno.errors.PermissionDenied` if the user does not have access - * rights - * - * Requires --allow-read. - */ - export function chdir(directory: string | URL): void; - - /** - * Return a string representing the current working directory. - * - * If the current directory can be reached via multiple paths (due to symbolic - * links), `cwd()` may return any one of them. - * - * ```ts - * const currentWorkingDirectory = Deno.cwd(); - * ``` - * - * Throws `Deno.errors.NotFound` if directory not available. - * - * Requires --allow-read - */ - export function cwd(): string; - - /** - * Synchronously creates `newpath` as a hard link to `oldpath`. - * - * ```ts - * Deno.linkSync("old/name", "new/name"); - * ``` - * - * Requires `allow-read` and `allow-write` permissions. */ - export function linkSync(oldpath: string, newpath: string): void; - - /** - * Creates `newpath` as a hard link to `oldpath`. - * - * ```ts - * await Deno.link("old/name", "new/name"); - * ``` - * - * Requires `allow-read` and `allow-write` permissions. */ - export function link(oldpath: string, newpath: string): Promise; - - export enum SeekMode { - Start = 0, - Current = 1, - End = 2, - } - - export interface Reader { - /** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of - * bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error - * encountered. Even if `read()` resolves to `n` < `p.byteLength`, it may - * use all of `p` as scratch space during the call. If some data is - * available but not `p.byteLength` bytes, `read()` conventionally resolves - * to what is available instead of waiting for more. - * - * When `read()` encounters end-of-file condition, it resolves to EOF - * (`null`). - * - * When `read()` encounters an error, it rejects with an error. - * - * Callers should always process the `n` > `0` bytes returned before - * considering the EOF (`null`). Doing so correctly handles I/O errors that - * happen after reading some bytes and also both of the allowed EOF - * behaviors. - * - * Implementations should not retain a reference to `p`. - * - * Use `itereateReader` from from https://deno.land/std/streams/conversion.ts to - * turn a Reader into an AsyncIterator. - */ - read(p: Uint8Array): Promise; - } - - export interface ReaderSync { - /** Reads up to `p.byteLength` bytes into `p`. It resolves to the number - * of bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error - * encountered. Even if `readSync()` returns `n` < `p.byteLength`, it may use - * all of `p` as scratch space during the call. If some data is available - * but not `p.byteLength` bytes, `readSync()` conventionally returns what is - * available instead of waiting for more. - * - * When `readSync()` encounters end-of-file condition, it returns EOF - * (`null`). - * - * When `readSync()` encounters an error, it throws with an error. - * - * Callers should always process the `n` > `0` bytes returned before - * considering the EOF (`null`). Doing so correctly handles I/O errors that happen - * after reading some bytes and also both of the allowed EOF behaviors. - * - * Implementations should not retain a reference to `p`. - * - * Use `iterateReaderSync()` from from https://deno.land/std/streams/conversion.ts - * to turn a ReaderSync into an Iterator. - */ - readSync(p: Uint8Array): number | null; - } - - export interface Writer { - /** Writes `p.byteLength` bytes from `p` to the underlying data stream. It - * resolves to the number of bytes written from `p` (`0` <= `n` <= - * `p.byteLength`) or reject with the error encountered that caused the - * write to stop early. `write()` must reject with a non-null error if - * would resolve to `n` < `p.byteLength`. `write()` must not modify the - * slice data, even temporarily. - * - * Implementations should not retain a reference to `p`. - */ - write(p: Uint8Array): Promise; - } - - export interface WriterSync { - /** Writes `p.byteLength` bytes from `p` to the underlying data - * stream. It returns the number of bytes written from `p` (`0` <= `n` - * <= `p.byteLength`) and any error encountered that caused the write to - * stop early. `writeSync()` must throw a non-null error if it returns `n` < - * `p.byteLength`. `writeSync()` must not modify the slice data, even - * temporarily. - * - * Implementations should not retain a reference to `p`. - */ - writeSync(p: Uint8Array): number; - } - - export interface Closer { - close(): void; - } - - export interface Seeker { - /** Seek sets the offset for the next `read()` or `write()` to offset, - * interpreted according to `whence`: `Start` means relative to the - * start of the file, `Current` means relative to the current offset, - * and `End` means relative to the end. Seek resolves to the new offset - * relative to the start of the file. - * - * Seeking to an offset before the start of the file is an error. Seeking to - * any positive offset is legal, but the behavior of subsequent I/O - * operations on the underlying object is implementation-dependent. - * It returns the number of cursor position. - */ - seek(offset: number, whence: SeekMode): Promise; - } - - export interface SeekerSync { - /** Seek sets the offset for the next `readSync()` or `writeSync()` to - * offset, interpreted according to `whence`: `Start` means relative - * to the start of the file, `Current` means relative to the current - * offset, and `End` means relative to the end. - * - * Seeking to an offset before the start of the file is an error. Seeking to - * any positive offset is legal, but the behavior of subsequent I/O - * operations on the underlying object is implementation-dependent. - */ - seekSync(offset: number, whence: SeekMode): number; - } - - /** - * Copies from `src` to `dst` until either EOF (`null`) is read from `src` or - * an error occurs. It resolves to the number of bytes copied or rejects with - * the first error encountered while copying. - * - * ```ts - * const source = await Deno.open("my_file.txt"); - * const bytesCopied1 = await Deno.copy(source, Deno.stdout); - * const destination = await Deno.create("my_file_2.txt"); - * const bytesCopied2 = await Deno.copy(source, destination); - * ``` - * - * @deprecated Use `copy` from https://deno.land/std/streams/conversion.ts - * instead. `Deno.copy` will be removed in Deno 2.0. - * - * @param src The source to copy from - * @param dst The destination to copy to - * @param options Can be used to tune size of the buffer. Default size is 32kB - */ - export function copy( - src: Reader, - dst: Writer, - options?: { - bufSize?: number; - }, - ): Promise; - - /** - * Turns a Reader, `r`, into an async iterator. - * - * ```ts - * let f = await Deno.open("/etc/passwd"); - * for await (const chunk of Deno.iter(f)) { - * console.log(chunk); - * } - * f.close(); - * ``` - * - * Second argument can be used to tune size of a buffer. - * Default size of the buffer is 32kB. - * - * ```ts - * let f = await Deno.open("/etc/passwd"); - * const iter = Deno.iter(f, { - * bufSize: 1024 * 1024 - * }); - * for await (const chunk of iter) { - * console.log(chunk); - * } - * f.close(); - * ``` - * - * Iterator uses an internal buffer of fixed size for efficiency; it returns - * a view on that buffer on each iteration. It is therefore caller's - * responsibility to copy contents of the buffer if needed; otherwise the - * next iteration will overwrite contents of previously returned chunk. - * - * @deprecated Use `iterateReader` from - * https://deno.land/std/streams/conversion.ts instead. `Deno.iter` will be - * removed in Deno 2.0. - */ - export function iter( - r: Reader, - options?: { - bufSize?: number; - }, - ): AsyncIterableIterator; - - /** - * Turns a ReaderSync, `r`, into an iterator. - * - * ```ts - * let f = Deno.openSync("/etc/passwd"); - * for (const chunk of Deno.iterSync(f)) { - * console.log(chunk); - * } - * f.close(); - * ``` - * - * Second argument can be used to tune size of a buffer. - * Default size of the buffer is 32kB. - * - * ```ts - * let f = await Deno.open("/etc/passwd"); - * const iter = Deno.iterSync(f, { - * bufSize: 1024 * 1024 - * }); - * for (const chunk of iter) { - * console.log(chunk); - * } - * f.close(); - * ``` - * - * Iterator uses an internal buffer of fixed size for efficiency; it returns - * a view on that buffer on each iteration. It is therefore caller's - * responsibility to copy contents of the buffer if needed; otherwise the - * next iteration will overwrite contents of previously returned chunk. - * - * @deprecated Use `iterateReaderSync` from - * https://deno.land/std/streams/conversion.ts instead. `Deno.iterSync` will - * be removed in Deno 2.0. - */ - export function iterSync( - r: ReaderSync, - options?: { - bufSize?: number; - }, - ): IterableIterator; - - /** Synchronously open a file and return an instance of `Deno.FsFile`. The - * file does not need to previously exist if using the `create` or `createNew` - * open options. It is the callers responsibility to close the file when finished - * with it. - * - * ```ts - * const file = Deno.openSync("/foo/bar.txt", { read: true, write: true }); - * // Do work with file - * Deno.close(file.rid); - * ``` - * - * Requires `allow-read` and/or `allow-write` permissions depending on options. - */ - export function openSync(path: string | URL, options?: OpenOptions): FsFile; - - /** Open a file and resolve to an instance of `Deno.FsFile`. The - * file does not need to previously exist if using the `create` or `createNew` - * open options. It is the callers responsibility to close the file when finished - * with it. - * - * ```ts - * const file = await Deno.open("/foo/bar.txt", { read: true, write: true }); - * // Do work with file - * Deno.close(file.rid); - * ``` - * - * Requires `allow-read` and/or `allow-write` permissions depending on options. - */ - export function open( - path: string | URL, - options?: OpenOptions, - ): Promise; - - /** Creates a file if none exists or truncates an existing file and returns - * an instance of `Deno.FsFile`. - * - * ```ts - * const file = Deno.createSync("/foo/bar.txt"); - * ``` - * - * Requires `allow-read` and `allow-write` permissions. - */ - export function createSync(path: string | URL): FsFile; - - /** Creates a file if none exists or truncates an existing file and resolves to - * an instance of `Deno.FsFile`. - * - * ```ts - * const file = await Deno.create("/foo/bar.txt"); - * ``` - * - * Requires `allow-read` and `allow-write` permissions. - */ - export function create(path: string | URL): Promise; - - /** Synchronously read from a resource ID (`rid`) into an array buffer (`buffer`). - * - * Returns either the number of bytes read during the operation or EOF - * (`null`) if there was nothing more to read. - * - * It is possible for a read to successfully return with `0` bytes. This does - * not indicate EOF. - * - * This function is one of the lowest level APIs and most users should not - * work with this directly, but rather use - * `readAllSync()` from https://deno.land/std/streams/conversion.ts instead. - * - * **It is not guaranteed that the full buffer will be read in a single call.** - * - * ```ts - * // if "/foo/bar.txt" contains the text "hello world": - * const file = Deno.openSync("/foo/bar.txt"); - * const buf = new Uint8Array(100); - * const numberOfBytesRead = Deno.readSync(file.rid, buf); // 11 bytes - * const text = new TextDecoder().decode(buf); // "hello world" - * Deno.close(file.rid); - * ``` - */ - export function readSync(rid: number, buffer: Uint8Array): number | null; - - /** Read from a resource ID (`rid`) into an array buffer (`buffer`). - * - * Resolves to either the number of bytes read during the operation or EOF - * (`null`) if there was nothing more to read. - * - * It is possible for a read to successfully return with `0` bytes. This does - * not indicate EOF. - * - * This function is one of the lowest level APIs and most users should not - * work with this directly, but rather use - * `readAll()` from https://deno.land/std/streams/conversion.ts instead. - * - * **It is not guaranteed that the full buffer will be read in a single call.** - * - * ```ts - * // if "/foo/bar.txt" contains the text "hello world": - * const file = await Deno.open("/foo/bar.txt"); - * const buf = new Uint8Array(100); - * const numberOfBytesRead = await Deno.read(file.rid, buf); // 11 bytes - * const text = new TextDecoder().decode(buf); // "hello world" - * Deno.close(file.rid); - * ``` - */ - export function read(rid: number, buffer: Uint8Array): Promise; - - /** Synchronously write to the resource ID (`rid`) the contents of the array - * buffer (`data`). - * - * Returns the number of bytes written. This function is one of the lowest - * level APIs and most users should not work with this directly, but rather use - * `writeAllSync()` from https://deno.land/std/streams/conversion.ts instead. - * - * **It is not guaranteed that the full buffer will be written in a single - * call.** - * - * ```ts - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world"); - * const file = Deno.openSync("/foo/bar.txt", {write: true}); - * const bytesWritten = Deno.writeSync(file.rid, data); // 11 - * Deno.close(file.rid); - * ``` - */ - export function writeSync(rid: number, data: Uint8Array): number; - - /** Write to the resource ID (`rid`) the contents of the array buffer (`data`). - * - * Resolves to the number of bytes written. This function is one of the lowest - * level APIs and most users should not work with this directly, but rather use - * `writeAll()` from https://deno.land/std/streams/conversion.ts instead. - * - * **It is not guaranteed that the full buffer will be written in a single - * call.** - * - * ```ts - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world"); - * const file = await Deno.open("/foo/bar.txt", { write: true }); - * const bytesWritten = await Deno.write(file.rid, data); // 11 - * Deno.close(file.rid); - * ``` - */ - export function write(rid: number, data: Uint8Array): Promise; - - /** Synchronously seek a resource ID (`rid`) to the given `offset` under mode - * given by `whence`. The new position within the resource (bytes from the - * start) is returned. - * - * ```ts - * const file = Deno.openSync('hello.txt', {read: true, write: true, truncate: true, create: true}); - * Deno.writeSync(file.rid, new TextEncoder().encode("Hello world")); - * - * // advance cursor 6 bytes - * const cursorPosition = Deno.seekSync(file.rid, 6, Deno.SeekMode.Start); - * console.log(cursorPosition); // 6 - * const buf = new Uint8Array(100); - * file.readSync(buf); - * console.log(new TextDecoder().decode(buf)); // "world" - * ``` - * - * The seek modes work as follows: - * - * ```ts - * // Given file.rid pointing to file with "Hello world", which is 11 bytes long: - * const file = Deno.openSync('hello.txt', {read: true, write: true, truncate: true, create: true}); - * Deno.writeSync(file.rid, new TextEncoder().encode("Hello world")); - * - * // Seek 6 bytes from the start of the file - * console.log(Deno.seekSync(file.rid, 6, Deno.SeekMode.Start)); // "6" - * // Seek 2 more bytes from the current position - * console.log(Deno.seekSync(file.rid, 2, Deno.SeekMode.Current)); // "8" - * // Seek backwards 2 bytes from the end of the file - * console.log(Deno.seekSync(file.rid, -2, Deno.SeekMode.End)); // "9" (e.g. 11-2) - * ``` - */ - export function seekSync( - rid: number, - offset: number, - whence: SeekMode, - ): number; - - /** Seek a resource ID (`rid`) to the given `offset` under mode given by `whence`. - * The call resolves to the new position within the resource (bytes from the start). - * - * ```ts - * // Given file.rid pointing to file with "Hello world", which is 11 bytes long: - * const file = await Deno.open('hello.txt', {read: true, write: true, truncate: true, create: true}); - * await Deno.write(file.rid, new TextEncoder().encode("Hello world")); - * - * // advance cursor 6 bytes - * const cursorPosition = await Deno.seek(file.rid, 6, Deno.SeekMode.Start); - * console.log(cursorPosition); // 6 - * const buf = new Uint8Array(100); - * await file.read(buf); - * console.log(new TextDecoder().decode(buf)); // "world" - * ``` - * - * The seek modes work as follows: - * - * ```ts - * // Given file.rid pointing to file with "Hello world", which is 11 bytes long: - * const file = await Deno.open('hello.txt', {read: true, write: true, truncate: true, create: true}); - * await Deno.write(file.rid, new TextEncoder().encode("Hello world")); - * - * // Seek 6 bytes from the start of the file - * console.log(await Deno.seek(file.rid, 6, Deno.SeekMode.Start)); // "6" - * // Seek 2 more bytes from the current position - * console.log(await Deno.seek(file.rid, 2, Deno.SeekMode.Current)); // "8" - * // Seek backwards 2 bytes from the end of the file - * console.log(await Deno.seek(file.rid, -2, Deno.SeekMode.End)); // "9" (e.g. 11-2) - * ``` - */ - export function seek( - rid: number, - offset: number, - whence: SeekMode, - ): Promise; - - /** - * Synchronously flushes any pending data and metadata operations of the given file stream to disk. - * ```ts - * const file = Deno.openSync("my_file.txt", { read: true, write: true, create: true }); - * Deno.writeSync(file.rid, new TextEncoder().encode("Hello World")); - * Deno.ftruncateSync(file.rid, 1); - * Deno.fsyncSync(file.rid); - * console.log(new TextDecoder().decode(Deno.readFileSync("my_file.txt"))); // H - * ``` - */ - export function fsyncSync(rid: number): void; - - /** - * Flushes any pending data and metadata operations of the given file stream to disk. - * ```ts - * const file = await Deno.open("my_file.txt", { read: true, write: true, create: true }); - * await Deno.write(file.rid, new TextEncoder().encode("Hello World")); - * await Deno.ftruncate(file.rid, 1); - * await Deno.fsync(file.rid); - * console.log(new TextDecoder().decode(await Deno.readFile("my_file.txt"))); // H - * ``` - */ - export function fsync(rid: number): Promise; - - /* - * Synchronously flushes any pending data operations of the given file stream to disk. - * ```ts - * const file = Deno.openSync("my_file.txt", { read: true, write: true, create: true }); - * Deno.writeSync(file.rid, new TextEncoder().encode("Hello World")); - * Deno.fdatasyncSync(file.rid); - * console.log(new TextDecoder().decode(Deno.readFileSync("my_file.txt"))); // Hello World - * ``` - */ - export function fdatasyncSync(rid: number): void; - - /** - * Flushes any pending data operations of the given file stream to disk. - * ```ts - * const file = await Deno.open("my_file.txt", { read: true, write: true, create: true }); - * await Deno.write(file.rid, new TextEncoder().encode("Hello World")); - * await Deno.fdatasync(file.rid); - * console.log(new TextDecoder().decode(await Deno.readFile("my_file.txt"))); // Hello World - * ``` - */ - export function fdatasync(rid: number): Promise; - - /** Close the given resource ID (rid) which has been previously opened, such - * as via opening or creating a file. Closing a file when you are finished - * with it is important to avoid leaking resources. - * - * ```ts - * const file = await Deno.open("my_file.txt"); - * // do work with "file" object - * Deno.close(file.rid); - * ```` - */ - export function close(rid: number): void; - - /** The Deno abstraction for reading and writing files. */ - export class FsFile - implements - Reader, - ReaderSync, - Writer, - WriterSync, - Seeker, - SeekerSync, - Closer { - readonly rid: number; - constructor(rid: number); - write(p: Uint8Array): Promise; - writeSync(p: Uint8Array): number; - truncate(len?: number): Promise; - truncateSync(len?: number): void; - read(p: Uint8Array): Promise; - readSync(p: Uint8Array): number | null; - seek(offset: number, whence: SeekMode): Promise; - seekSync(offset: number, whence: SeekMode): number; - stat(): Promise; - statSync(): FileInfo; - close(): void; - - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - - /** - * @deprecated Use `Deno.FsFile` instead. `Deno.File` will be removed in Deno 2.0. - * - * The Deno abstraction for reading and writing files. - */ - export class File - implements - Reader, - ReaderSync, - Writer, - WriterSync, - Seeker, - SeekerSync, - Closer { - readonly rid: number; - constructor(rid: number); - write(p: Uint8Array): Promise; - writeSync(p: Uint8Array): number; - truncate(len?: number): Promise; - truncateSync(len?: number): void; - read(p: Uint8Array): Promise; - readSync(p: Uint8Array): number | null; - seek(offset: number, whence: SeekMode): Promise; - seekSync(offset: number, whence: SeekMode): number; - stat(): Promise; - statSync(): FileInfo; - close(): void; - - readonly readable: ReadableStream; - readonly writable: WritableStream; - } - - /** A handle for `stdin`. */ - export const stdin: Reader & ReaderSync & Closer & { - readonly rid: number; - readonly readable: ReadableStream; - }; - /** A handle for `stdout`. */ - export const stdout: Writer & WriterSync & Closer & { - readonly rid: number; - readonly writable: WritableStream; - }; - /** A handle for `stderr`. */ - export const stderr: Writer & WriterSync & Closer & { - readonly rid: number; - readonly writable: WritableStream; - }; - - export interface OpenOptions { - /** Sets the option for read access. This option, when `true`, means that the - * file should be read-able if opened. */ - read?: boolean; - /** Sets the option for write access. This option, when `true`, means that - * the file should be write-able if opened. If the file already exists, - * any write calls on it will overwrite its contents, by default without - * truncating it. */ - write?: boolean; - /** Sets the option for the append mode. This option, when `true`, means that - * writes will append to a file instead of overwriting previous contents. - * Note that setting `{ write: true, append: true }` has the same effect as - * setting only `{ append: true }`. */ - append?: boolean; - /** Sets the option for truncating a previous file. If a file is - * successfully opened with this option set it will truncate the file to `0` - * size if it already exists. The file must be opened with write access - * for truncate to work. */ - truncate?: boolean; - /** Sets the option to allow creating a new file, if one doesn't already - * exist at the specified path. Requires write or append access to be - * used. */ - create?: boolean; - /** Defaults to `false`. If set to `true`, no file, directory, or symlink is - * allowed to exist at the target location. Requires write or append - * access to be used. When createNew is set to `true`, create and truncate - * are ignored. */ - createNew?: boolean; - /** Permissions to use if creating the file (defaults to `0o666`, before - * the process's umask). - * Ignored on Windows. */ - mode?: number; - } - - export interface ReadFileOptions { - /** - * An abort signal to allow cancellation of the file read operation. - * If the signal becomes aborted the readFile operation will be stopped - * and the promise returned will be rejected with an AbortError. - */ - signal?: AbortSignal; - } - - /** - * Check if a given resource id (`rid`) is a TTY. - * - * ```ts - * // This example is system and context specific - * const nonTTYRid = Deno.openSync("my_file.txt").rid; - * const ttyRid = Deno.openSync("/dev/tty6").rid; - * console.log(Deno.isatty(nonTTYRid)); // false - * console.log(Deno.isatty(ttyRid)); // true - * Deno.close(nonTTYRid); - * Deno.close(ttyRid); - * ``` - */ - export function isatty(rid: number): boolean; - - /** - * @deprecated Use Buffer from https://deno.land/std/io/buffer.ts instead. Deno.Buffer will be removed in Deno 2.0. - * - * A variable-sized buffer of bytes with `read()` and `write()` methods. - * - * Deno.Buffer is almost always used with some I/O like files and sockets. It - * allows one to buffer up a download from a socket. Buffer grows and shrinks - * as necessary. - * - * Deno.Buffer is NOT the same thing as Node's Buffer. Node's Buffer was - * created in 2009 before JavaScript had the concept of ArrayBuffers. It's - * simply a non-standard ArrayBuffer. - * - * ArrayBuffer is a fixed memory allocation. Deno.Buffer is implemented on top - * of ArrayBuffer. - * - * Based on [Go Buffer](https://golang.org/pkg/bytes/#Buffer). */ - export class Buffer implements Reader, ReaderSync, Writer, WriterSync { - constructor(ab?: ArrayBuffer); - /** Returns a slice holding the unread portion of the buffer. - * - * The slice is valid for use only until the next buffer modification (that - * is, only until the next call to a method like `read()`, `write()`, - * `reset()`, or `truncate()`). If `options.copy` is false the slice aliases the buffer content at - * least until the next buffer modification, so immediate changes to the - * slice will affect the result of future reads. - * @param options Defaults to `{ copy: true }` - */ - bytes(options?: { copy?: boolean }): Uint8Array; - /** Returns whether the unread portion of the buffer is empty. */ - empty(): boolean; - /** A read only number of bytes of the unread portion of the buffer. */ - readonly length: number; - /** The read only capacity of the buffer's underlying byte slice, that is, - * the total space allocated for the buffer's data. */ - readonly capacity: number; - /** Discards all but the first `n` unread bytes from the buffer but - * continues to use the same allocated storage. It throws if `n` is - * negative or greater than the length of the buffer. */ - truncate(n: number): void; - /** Resets the buffer to be empty, but it retains the underlying storage for - * use by future writes. `.reset()` is the same as `.truncate(0)`. */ - reset(): void; - /** Reads the next `p.length` bytes from the buffer or until the buffer is - * drained. Returns the number of bytes read. If the buffer has no data to - * return, the return is EOF (`null`). */ - readSync(p: Uint8Array): number | null; - /** Reads the next `p.length` bytes from the buffer or until the buffer is - * drained. Resolves to the number of bytes read. If the buffer has no - * data to return, resolves to EOF (`null`). - * - * NOTE: This methods reads bytes synchronously; it's provided for - * compatibility with `Reader` interfaces. - */ - read(p: Uint8Array): Promise; - writeSync(p: Uint8Array): number; - /** NOTE: This methods writes bytes synchronously; it's provided for - * compatibility with `Writer` interface. */ - write(p: Uint8Array): Promise; - /** Grows the buffer's capacity, if necessary, to guarantee space for - * another `n` bytes. After `.grow(n)`, at least `n` bytes can be written to - * the buffer without another allocation. If `n` is negative, `.grow()` will - * throw. If the buffer can't grow it will throw an error. - * - * Based on Go Lang's - * [Buffer.Grow](https://golang.org/pkg/bytes/#Buffer.Grow). */ - grow(n: number): void; - /** Reads data from `r` until EOF (`null`) and appends it to the buffer, - * growing the buffer as needed. It resolves to the number of bytes read. - * If the buffer becomes too large, `.readFrom()` will reject with an error. - * - * Based on Go Lang's - * [Buffer.ReadFrom](https://golang.org/pkg/bytes/#Buffer.ReadFrom). */ - readFrom(r: Reader): Promise; - /** Reads data from `r` until EOF (`null`) and appends it to the buffer, - * growing the buffer as needed. It returns the number of bytes read. If the - * buffer becomes too large, `.readFromSync()` will throw an error. - * - * Based on Go Lang's - * [Buffer.ReadFrom](https://golang.org/pkg/bytes/#Buffer.ReadFrom). */ - readFromSync(r: ReaderSync): number; - } - - /** - * Read Reader `r` until EOF (`null`) and resolve to the content as - * Uint8Array`. - * - * ```ts - * // Example from stdin - * const stdinContent = await Deno.readAll(Deno.stdin); - * - * // Example from file - * const file = await Deno.open("my_file.txt", {read: true}); - * const myFileContent = await Deno.readAll(file); - * Deno.close(file.rid); - * - * // Example from buffer - * const myData = new Uint8Array(100); - * // ... fill myData array with data - * const reader = new Deno.Buffer(myData.buffer as ArrayBuffer); - * const bufferContent = await Deno.readAll(reader); - * ``` - * - * @deprecated Use `readAll` from https://deno.land/std/streams/conversion.ts - * instead. `Deno.readAll` will be removed in Deno 2.0. - */ - export function readAll(r: Reader): Promise; - - /** - * Synchronously reads Reader `r` until EOF (`null`) and returns the content - * as `Uint8Array`. - * - * ```ts - * // Example from stdin - * const stdinContent = Deno.readAllSync(Deno.stdin); - * - * // Example from file - * const file = Deno.openSync("my_file.txt", {read: true}); - * const myFileContent = Deno.readAllSync(file); - * Deno.close(file.rid); - * - * // Example from buffer - * const myData = new Uint8Array(100); - * // ... fill myData array with data - * const reader = new Deno.Buffer(myData.buffer as ArrayBuffer); - * const bufferContent = Deno.readAllSync(reader); - * ``` - * - * @deprecated Use `readAllSync` from - * https://deno.land/std/streams/conversion.ts instead. `Deno.readAllSync` - * will be removed in Deno 2.0. - */ - export function readAllSync(r: ReaderSync): Uint8Array; - - /** - * Write all the content of the array buffer (`arr`) to the writer (`w`). - * - * ```ts - * // Example writing to stdout - * const contentBytes = new TextEncoder().encode("Hello World"); - * await Deno.writeAll(Deno.stdout, contentBytes); - * ``` - * - * ```ts - * // Example writing to file - * const contentBytes = new TextEncoder().encode("Hello World"); - * const file = await Deno.open('test.file', {write: true}); - * await Deno.writeAll(file, contentBytes); - * Deno.close(file.rid); - * ``` - * - * ```ts - * // Example writing to buffer - * const contentBytes = new TextEncoder().encode("Hello World"); - * const writer = new Deno.Buffer(); - * await Deno.writeAll(writer, contentBytes); - * console.log(writer.bytes().length); // 11 - * ``` - * - * @deprecated Use `writeAll` from https://deno.land/std/streams/conversion.ts - * instead. `Deno.writeAll` will be removed in Deno 2.0. - */ - export function writeAll(w: Writer, arr: Uint8Array): Promise; - - /** - * Synchronously write all the content of the array buffer (`arr`) to the - * writer (`w`). - * - * ```ts - * // Example writing to stdout - * const contentBytes = new TextEncoder().encode("Hello World"); - * Deno.writeAllSync(Deno.stdout, contentBytes); - * ``` - * - * ```ts - * // Example writing to file - * const contentBytes = new TextEncoder().encode("Hello World"); - * const file = Deno.openSync('test.file', {write: true}); - * Deno.writeAllSync(file, contentBytes); - * Deno.close(file.rid); - * ``` - * - * ```ts - * // Example writing to buffer - * const contentBytes = new TextEncoder().encode("Hello World"); - * const writer = new Deno.Buffer(); - * Deno.writeAllSync(writer, contentBytes); - * console.log(writer.bytes().length); // 11 - * ``` - * - * @deprecated Use `writeAllSync` from - * https://deno.land/std/streams/conversion.ts instead. `Deno.writeAllSync` - * will be removed in Deno 2.0. - */ - export function writeAllSync(w: WriterSync, arr: Uint8Array): void; - - export interface MkdirOptions { - /** Defaults to `false`. If set to `true`, means that any intermediate - * directories will also be created (as with the shell command `mkdir -p`). - * Intermediate directories are created with the same permissions. - * When recursive is set to `true`, succeeds silently (without changing any - * permissions) if a directory already exists at the path, or if the path - * is a symlink to an existing directory. */ - recursive?: boolean; - /** Permissions to use when creating the directory (defaults to `0o777`, - * before the process's umask). - * Ignored on Windows. */ - mode?: number; - } - - /** Synchronously creates a new directory with the specified path. - * - * ```ts - * Deno.mkdirSync("new_dir"); - * Deno.mkdirSync("nested/directories", { recursive: true }); - * Deno.mkdirSync("restricted_access_dir", { mode: 0o700 }); - * ``` - * - * Defaults to throwing error if the directory already exists. - * - * Requires `allow-write` permission. */ - export function mkdirSync(path: string | URL, options?: MkdirOptions): void; - - /** Creates a new directory with the specified path. - * - * ```ts - * await Deno.mkdir("new_dir"); - * await Deno.mkdir("nested/directories", { recursive: true }); - * await Deno.mkdir("restricted_access_dir", { mode: 0o700 }); - * ``` - * - * Defaults to throwing error if the directory already exists. - * - * Requires `allow-write` permission. */ - export function mkdir( - path: string | URL, - options?: MkdirOptions, - ): Promise; - - export interface MakeTempOptions { - /** Directory where the temporary directory should be created (defaults to - * the env variable TMPDIR, or the system's default, usually /tmp). - * - * Note that if the passed `dir` is relative, the path returned by - * makeTempFile() and makeTempDir() will also be relative. Be mindful of - * this when changing working directory. */ - dir?: string; - /** String that should precede the random portion of the temporary - * directory's name. */ - prefix?: string; - /** String that should follow the random portion of the temporary - * directory's name. */ - suffix?: string; - } - - /** Synchronously creates a new temporary directory in the default directory - * for temporary files, unless `dir` is specified. Other optional options - * include prefixing and suffixing the directory name with `prefix` and - * `suffix` respectively. - * - * The full path to the newly created directory is returned. - * - * Multiple programs calling this function simultaneously will create different - * directories. It is the caller's responsibility to remove the directory when - * no longer needed. - * - * ```ts - * const tempDirName0 = Deno.makeTempDirSync(); // e.g. /tmp/2894ea76 - * const tempDirName1 = Deno.makeTempDirSync({ prefix: 'my_temp' }); // e.g. /tmp/my_temp339c944d - * ``` - * - * Requires `allow-write` permission. */ - // TODO(ry) Doesn't check permissions. - export function makeTempDirSync(options?: MakeTempOptions): string; - - /** Creates a new temporary directory in the default directory for temporary - * files, unless `dir` is specified. Other optional options include - * prefixing and suffixing the directory name with `prefix` and `suffix` - * respectively. - * - * This call resolves to the full path to the newly created directory. - * - * Multiple programs calling this function simultaneously will create different - * directories. It is the caller's responsibility to remove the directory when - * no longer needed. - * - * ```ts - * const tempDirName0 = await Deno.makeTempDir(); // e.g. /tmp/2894ea76 - * const tempDirName1 = await Deno.makeTempDir({ prefix: 'my_temp' }); // e.g. /tmp/my_temp339c944d - * ``` - * - * Requires `allow-write` permission. */ - // TODO(ry) Doesn't check permissions. - export function makeTempDir(options?: MakeTempOptions): Promise; - - /** Synchronously creates a new temporary file in the default directory for - * temporary files, unless `dir` is specified. - * Other optional options include prefixing and suffixing the directory name - * with `prefix` and `suffix` respectively. - * - * The full path to the newly created file is returned. - * - * Multiple programs calling this function simultaneously will create different - * files. It is the caller's responsibility to remove the file when no longer - * needed. - * - * ```ts - * const tempFileName0 = Deno.makeTempFileSync(); // e.g. /tmp/419e0bf2 - * const tempFileName1 = Deno.makeTempFileSync({ prefix: 'my_temp' }); // e.g. /tmp/my_temp754d3098 - * ``` - * - * Requires `allow-write` permission. */ - export function makeTempFileSync(options?: MakeTempOptions): string; - - /** Creates a new temporary file in the default directory for temporary - * files, unless `dir` is specified. Other - * optional options include prefixing and suffixing the directory name with - * `prefix` and `suffix` respectively. - * - * This call resolves to the full path to the newly created file. - * - * Multiple programs calling this function simultaneously will create different - * files. It is the caller's responsibility to remove the file when no longer - * needed. - * - * ```ts - * const tmpFileName0 = await Deno.makeTempFile(); // e.g. /tmp/419e0bf2 - * const tmpFileName1 = await Deno.makeTempFile({ prefix: 'my_temp' }); // e.g. /tmp/my_temp754d3098 - * ``` - * - * Requires `allow-write` permission. */ - export function makeTempFile(options?: MakeTempOptions): Promise; - - /** Synchronously changes the permission of a specific file/directory of - * specified path. Ignores the process's umask. - * - * ```ts - * Deno.chmodSync("/path/to/file", 0o666); - * ``` - * - * For a full description, see [chmod](#Deno.chmod) - * - * NOTE: This API currently throws on Windows - * - * Requires `allow-write` permission. */ - export function chmodSync(path: string | URL, mode: number): void; - - /** Changes the permission of a specific file/directory of specified path. - * Ignores the process's umask. - * - * ```ts - * await Deno.chmod("/path/to/file", 0o666); - * ``` - * - * The mode is a sequence of 3 octal numbers. The first/left-most number - * specifies the permissions for the owner. The second number specifies the - * permissions for the group. The last/right-most number specifies the - * permissions for others. For example, with a mode of 0o764, the owner (7) can - * read/write/execute, the group (6) can read/write and everyone else (4) can - * read only. - * - * | Number | Description | - * | ------ | ----------- | - * | 7 | read, write, and execute | - * | 6 | read and write | - * | 5 | read and execute | - * | 4 | read only | - * | 3 | write and execute | - * | 2 | write only | - * | 1 | execute only | - * | 0 | no permission | - * - * NOTE: This API currently throws on Windows - * - * Requires `allow-write` permission. */ - export function chmod(path: string | URL, mode: number): Promise; - - /** Synchronously change owner of a regular file or directory. This functionality - * is not available on Windows. - * - * ```ts - * Deno.chownSync("myFile.txt", 1000, 1002); - * ``` - * - * Requires `allow-write` permission. - * - * Throws Error (not implemented) if executed on Windows - * - * @param path path to the file - * @param uid user id (UID) of the new owner, or `null` for no change - * @param gid group id (GID) of the new owner, or `null` for no change - */ - export function chownSync( - path: string | URL, - uid: number | null, - gid: number | null, - ): void; - - /** Change owner of a regular file or directory. This functionality - * is not available on Windows. - * - * ```ts - * await Deno.chown("myFile.txt", 1000, 1002); - * ``` - * - * Requires `allow-write` permission. - * - * Throws Error (not implemented) if executed on Windows - * - * @param path path to the file - * @param uid user id (UID) of the new owner, or `null` for no change - * @param gid group id (GID) of the new owner, or `null` for no change - */ - export function chown( - path: string | URL, - uid: number | null, - gid: number | null, - ): Promise; - - export interface RemoveOptions { - /** Defaults to `false`. If set to `true`, path will be removed even if - * it's a non-empty directory. */ - recursive?: boolean; - } - - /** Synchronously removes the named file or directory. - * - * ```ts - * Deno.removeSync("/path/to/empty_dir/or/file"); - * Deno.removeSync("/path/to/populated_dir/or/file", { recursive: true }); - * ``` - * - * Throws error if permission denied, path not found, or path is a non-empty - * directory and the `recursive` option isn't set to `true`. - * - * Requires `allow-write` permission. */ - export function removeSync(path: string | URL, options?: RemoveOptions): void; - - /** Removes the named file or directory. - * - * ```ts - * await Deno.remove("/path/to/empty_dir/or/file"); - * await Deno.remove("/path/to/populated_dir/or/file", { recursive: true }); - * ``` - * - * Throws error if permission denied, path not found, or path is a non-empty - * directory and the `recursive` option isn't set to `true`. - * - * Requires `allow-write` permission. */ - export function remove( - path: string | URL, - options?: RemoveOptions, - ): Promise; - - /** Synchronously renames (moves) `oldpath` to `newpath`. Paths may be files or - * directories. If `newpath` already exists and is not a directory, - * `renameSync()` replaces it. OS-specific restrictions may apply when - * `oldpath` and `newpath` are in different directories. - * - * ```ts - * Deno.renameSync("old/path", "new/path"); - * ``` - * - * On Unix, this operation does not follow symlinks at either path. - * - * It varies between platforms when the operation throws errors, and if so what - * they are. It's always an error to rename anything to a non-empty directory. - * - * Requires `allow-read` and `allow-write` permissions. */ - export function renameSync( - oldpath: string | URL, - newpath: string | URL, - ): void; - - /** Renames (moves) `oldpath` to `newpath`. Paths may be files or directories. - * If `newpath` already exists and is not a directory, `rename()` replaces it. - * OS-specific restrictions may apply when `oldpath` and `newpath` are in - * different directories. - * - * ```ts - * await Deno.rename("old/path", "new/path"); - * ``` - * - * On Unix, this operation does not follow symlinks at either path. - * - * It varies between platforms when the operation throws errors, and if so what - * they are. It's always an error to rename anything to a non-empty directory. - * - * Requires `allow-read` and `allow-write` permission. */ - export function rename( - oldpath: string | URL, - newpath: string | URL, - ): Promise; - - /** Synchronously reads and returns the entire contents of a file as utf8 - * encoded string. Reading a directory throws an error. - * - * ```ts - * const data = Deno.readTextFileSync("hello.txt"); - * console.log(data); - * ``` - * - * Requires `allow-read` permission. */ - export function readTextFileSync(path: string | URL): string; - - /** Asynchronously reads and returns the entire contents of a file as utf8 - * encoded string. Reading a directory throws an error. - * - * ```ts - * const data = await Deno.readTextFile("hello.txt"); - * console.log(data); - * ``` - * - * Requires `allow-read` permission. */ - export function readTextFile( - path: string | URL, - options?: ReadFileOptions, - ): Promise; - - /** Synchronously reads and returns the entire contents of a file as an array - * of bytes. `TextDecoder` can be used to transform the bytes to string if - * required. Reading a directory returns an empty data array. - * - * ```ts - * const decoder = new TextDecoder("utf-8"); - * const data = Deno.readFileSync("hello.txt"); - * console.log(decoder.decode(data)); - * ``` - * - * Requires `allow-read` permission. */ - export function readFileSync(path: string | URL): Uint8Array; - - /** Reads and resolves to the entire contents of a file as an array of bytes. - * `TextDecoder` can be used to transform the bytes to string if required. - * Reading a directory returns an empty data array. - * - * ```ts - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello.txt"); - * console.log(decoder.decode(data)); - * ``` - * - * Requires `allow-read` permission. */ - export function readFile( - path: string | URL, - options?: ReadFileOptions, - ): Promise; - - /** A FileInfo describes a file and is returned by `stat`, `lstat`, - * `statSync`, `lstatSync`. */ - export interface FileInfo { - /** True if this is info for a regular file. Mutually exclusive to - * `FileInfo.isDirectory` and `FileInfo.isSymlink`. */ - isFile: boolean; - /** True if this is info for a regular directory. Mutually exclusive to - * `FileInfo.isFile` and `FileInfo.isSymlink`. */ - isDirectory: boolean; - /** True if this is info for a symlink. Mutually exclusive to - * `FileInfo.isFile` and `FileInfo.isDirectory`. */ - isSymlink: boolean; - /** The size of the file, in bytes. */ - size: number; - /** The last modification time of the file. This corresponds to the `mtime` - * field from `stat` on Linux/Mac OS and `ftLastWriteTime` on Windows. This - * may not be available on all platforms. */ - mtime: Date | null; - /** The last access time of the file. This corresponds to the `atime` - * field from `stat` on Unix and `ftLastAccessTime` on Windows. This may not - * be available on all platforms. */ - atime: Date | null; - /** The creation time of the file. This corresponds to the `birthtime` - * field from `stat` on Mac/BSD and `ftCreationTime` on Windows. This may - * not be available on all platforms. */ - birthtime: Date | null; - /** ID of the device containing the file. - * - * _Linux/Mac OS only._ */ - dev: number | null; - /** Inode number. - * - * _Linux/Mac OS only._ */ - ino: number | null; - /** **UNSTABLE**: Match behavior with Go on Windows for `mode`. - * - * The underlying raw `st_mode` bits that contain the standard Unix - * permissions for this file/directory. */ - mode: number | null; - /** Number of hard links pointing to this file. - * - * _Linux/Mac OS only._ */ - nlink: number | null; - /** User ID of the owner of this file. - * - * _Linux/Mac OS only._ */ - uid: number | null; - /** Group ID of the owner of this file. - * - * _Linux/Mac OS only._ */ - gid: number | null; - /** Device ID of this file. - * - * _Linux/Mac OS only._ */ - rdev: number | null; - /** Blocksize for filesystem I/O. - * - * _Linux/Mac OS only._ */ - blksize: number | null; - /** Number of blocks allocated to the file, in 512-byte units. - * - * _Linux/Mac OS only._ */ - blocks: number | null; - } - - /** Returns absolute normalized path, with symbolic links resolved. - * - * ```ts - * // e.g. given /home/alice/file.txt and current directory /home/alice - * Deno.symlinkSync("file.txt", "symlink_file.txt"); - * const realPath = Deno.realPathSync("./file.txt"); - * const realSymLinkPath = Deno.realPathSync("./symlink_file.txt"); - * console.log(realPath); // outputs "/home/alice/file.txt" - * console.log(realSymLinkPath); // outputs "/home/alice/file.txt" - * ``` - * - * Requires `allow-read` permission for the target path. - * Also requires `allow-read` permission for the CWD if the target path is - * relative. */ - export function realPathSync(path: string | URL): string; - - /** Resolves to the absolute normalized path, with symbolic links resolved. - * - * ```ts - * // e.g. given /home/alice/file.txt and current directory /home/alice - * await Deno.symlink("file.txt", "symlink_file.txt"); - * const realPath = await Deno.realPath("./file.txt"); - * const realSymLinkPath = await Deno.realPath("./symlink_file.txt"); - * console.log(realPath); // outputs "/home/alice/file.txt" - * console.log(realSymLinkPath); // outputs "/home/alice/file.txt" - * ``` - * - * Requires `allow-read` permission for the target path. - * Also requires `allow-read` permission for the CWD if the target path is - * relative. */ - export function realPath(path: string | URL): Promise; - - export interface DirEntry { - name: string; - isFile: boolean; - isDirectory: boolean; - isSymlink: boolean; - } - - /** Synchronously reads the directory given by `path` and returns an iterable - * of `Deno.DirEntry`. - * - * ```ts - * for (const dirEntry of Deno.readDirSync("/")) { - * console.log(dirEntry.name); - * } - * ``` - * - * Throws error if `path` is not a directory. - * - * Requires `allow-read` permission. */ - export function readDirSync(path: string | URL): Iterable; - - /** Reads the directory given by `path` and returns an async iterable of - * `Deno.DirEntry`. - * - * ```ts - * for await (const dirEntry of Deno.readDir("/")) { - * console.log(dirEntry.name); - * } - * ``` - * - * Throws error if `path` is not a directory. - * - * Requires `allow-read` permission. */ - export function readDir(path: string | URL): AsyncIterable; - - /** Synchronously copies the contents and permissions of one file to another - * specified path, by default creating a new file if needed, else overwriting. - * Fails if target path is a directory or is unwritable. - * - * ```ts - * Deno.copyFileSync("from.txt", "to.txt"); - * ``` - * - * Requires `allow-read` permission on fromPath. - * Requires `allow-write` permission on toPath. */ - export function copyFileSync( - fromPath: string | URL, - toPath: string | URL, - ): void; - - /** Copies the contents and permissions of one file to another specified path, - * by default creating a new file if needed, else overwriting. Fails if target - * path is a directory or is unwritable. - * - * ```ts - * await Deno.copyFile("from.txt", "to.txt"); - * ``` - * - * Requires `allow-read` permission on fromPath. - * Requires `allow-write` permission on toPath. */ - export function copyFile( - fromPath: string | URL, - toPath: string | URL, - ): Promise; - - /** Returns the full path destination of the named symbolic link. - * - * ```ts - * Deno.symlinkSync("./test.txt", "./test_link.txt"); - * const target = Deno.readLinkSync("./test_link.txt"); // full path of ./test.txt - * ``` - * - * Throws TypeError if called with a hard link - * - * Requires `allow-read` permission. */ - export function readLinkSync(path: string | URL): string; - - /** Resolves to the full path destination of the named symbolic link. - * - * ```ts - * await Deno.symlink("./test.txt", "./test_link.txt"); - * const target = await Deno.readLink("./test_link.txt"); // full path of ./test.txt - * ``` - * - * Throws TypeError if called with a hard link - * - * Requires `allow-read` permission. */ - export function readLink(path: string | URL): Promise; - - /** Resolves to a `Deno.FileInfo` for the specified `path`. If `path` is a - * symlink, information for the symlink will be returned instead of what it - * points to. - * - * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; - * const fileInfo = await Deno.lstat("hello.txt"); - * assert(fileInfo.isFile); - * ``` - * - * Requires `allow-read` permission. */ - export function lstat(path: string | URL): Promise; - - /** Synchronously returns a `Deno.FileInfo` for the specified `path`. If - * `path` is a symlink, information for the symlink will be returned instead of - * what it points to.. - * - * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; - * const fileInfo = Deno.lstatSync("hello.txt"); - * assert(fileInfo.isFile); - * ``` - * - * Requires `allow-read` permission. */ - export function lstatSync(path: string | URL): FileInfo; - - /** Resolves to a `Deno.FileInfo` for the specified `path`. Will always - * follow symlinks. - * - * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; - * const fileInfo = await Deno.stat("hello.txt"); - * assert(fileInfo.isFile); - * ``` - * - * Requires `allow-read` permission. */ - export function stat(path: string | URL): Promise; - - /** Synchronously returns a `Deno.FileInfo` for the specified `path`. Will - * always follow symlinks. - * - * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; - * const fileInfo = Deno.statSync("hello.txt"); - * assert(fileInfo.isFile); - * ``` - * - * Requires `allow-read` permission. */ - export function statSync(path: string | URL): FileInfo; - - /** Options for writing to a file. */ - export interface WriteFileOptions { - /** Defaults to `false`. If set to `true`, will append to a file instead of - * overwriting previous contents. */ - append?: boolean; - /** Sets the option to allow creating a new file, if one doesn't already - * exist at the specified path (defaults to `true`). */ - create?: boolean; - /** Permissions always applied to file. */ - mode?: number; - /** - * An abort signal to allow cancellation of the file write operation. - * If the signal becomes aborted the writeFile operation will be stopped - * and the promise returned will be rejected with an AbortError. - */ - signal?: AbortSignal; - } - - /** Synchronously write `data` to the given `path`, by default creating a new - * file if needed, else overwriting. - * - * ```ts - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world\n"); - * Deno.writeFileSync("hello1.txt", data); // overwrite "hello1.txt" or create it - * Deno.writeFileSync("hello2.txt", data, {create: false}); // only works if "hello2.txt" exists - * Deno.writeFileSync("hello3.txt", data, {mode: 0o777}); // set permissions on new file - * Deno.writeFileSync("hello4.txt", data, {append: true}); // add data to the end of the file - * ``` - * - * Requires `allow-write` permission, and `allow-read` if `options.create` is - * `false`. - */ - export function writeFileSync( - path: string | URL, - data: Uint8Array, - options?: WriteFileOptions, - ): void; - - /** Write `data` to the given `path`, by default creating a new file if needed, - * else overwriting. - * - * ```ts - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world\n"); - * await Deno.writeFile("hello1.txt", data); // overwrite "hello1.txt" or create it - * await Deno.writeFile("hello2.txt", data, {create: false}); // only works if "hello2.txt" exists - * await Deno.writeFile("hello3.txt", data, {mode: 0o777}); // set permissions on new file - * await Deno.writeFile("hello4.txt", data, {append: true}); // add data to the end of the file - * ``` - * - * Requires `allow-write` permission, and `allow-read` if `options.create` is `false`. - */ - export function writeFile( - path: string | URL, - data: Uint8Array, - options?: WriteFileOptions, - ): Promise; - - /** Synchronously write string `data` to the given `path`, by default creating a new file if needed, - * else overwriting. - * - * ```ts - * Deno.writeTextFileSync("hello1.txt", "Hello world\n"); // overwrite "hello1.txt" or create it - * ``` - * - * Requires `allow-write` permission, and `allow-read` if `options.create` is `false`. - */ - export function writeTextFileSync( - path: string | URL, - data: string, - options?: WriteFileOptions, - ): void; - - /** Asynchronously write string `data` to the given `path`, by default creating a new file if needed, - * else overwriting. - * - * ```ts - * await Deno.writeTextFile("hello1.txt", "Hello world\n"); // overwrite "hello1.txt" or create it - * ``` - * - * Requires `allow-write` permission, and `allow-read` if `options.create` is `false`. - */ - export function writeTextFile( - path: string | URL, - data: string, - options?: WriteFileOptions, - ): Promise; - - /** Synchronously truncates or extends the specified file, to reach the - * specified `len`. If `len` is not specified then the entire file contents - * are truncated. - * - * ```ts - * // truncate the entire file - * Deno.truncateSync("my_file.txt"); - * - * // truncate part of the file - * const file = Deno.makeTempFileSync(); - * Deno.writeFileSync(file, new TextEncoder().encode("Hello World")); - * Deno.truncateSync(file, 7); - * const data = Deno.readFileSync(file); - * console.log(new TextDecoder().decode(data)); - * ``` - * - * Requires `allow-write` permission. */ - export function truncateSync(name: string, len?: number): void; - - /** Truncates or extends the specified file, to reach the specified `len`. If - * `len` is not specified then the entire file contents are truncated. - * - * ```ts - * // truncate the entire file - * await Deno.truncate("my_file.txt"); - * - * // truncate part of the file - * const file = await Deno.makeTempFile(); - * await Deno.writeFile(file, new TextEncoder().encode("Hello World")); - * await Deno.truncate(file, 7); - * const data = await Deno.readFile(file); - * console.log(new TextDecoder().decode(data)); // "Hello W" - * ``` - * - * Requires `allow-write` permission. */ - export function truncate(name: string, len?: number): Promise; - - export interface OpMetrics { - opsDispatched: number; - opsDispatchedSync: number; - opsDispatchedAsync: number; - opsDispatchedAsyncUnref: number; - opsCompleted: number; - opsCompletedSync: number; - opsCompletedAsync: number; - opsCompletedAsyncUnref: number; - bytesSentControl: number; - bytesSentData: number; - bytesReceived: number; - } - - export interface Metrics extends OpMetrics { - ops: Record; - } - - /** Receive metrics from the privileged side of Deno. This is primarily used - * in the development of Deno. 'Ops', also called 'bindings', are the go-between - * between Deno JavaScript and Deno Rust. - * - * > console.table(Deno.metrics()) - * ┌─────────────────────────┬────────┐ - * │ (index) │ Values │ - * ├─────────────────────────┼────────┤ - * │ opsDispatched │ 3 │ - * │ opsDispatchedSync │ 2 │ - * │ opsDispatchedAsync │ 1 │ - * │ opsDispatchedAsyncUnref │ 0 │ - * │ opsCompleted │ 3 │ - * │ opsCompletedSync │ 2 │ - * │ opsCompletedAsync │ 1 │ - * │ opsCompletedAsyncUnref │ 0 │ - * │ bytesSentControl │ 73 │ - * │ bytesSentData │ 0 │ - * │ bytesReceived │ 375 │ - * └─────────────────────────┴────────┘ - */ - export function metrics(): Metrics; - - interface ResourceMap { - // deno-lint-ignore no-explicit-any - [rid: number]: any; - } - - /** Returns a map of open resource ids (rid) along with their string - * representations. This is an internal API and as such resource - * representation has `any` type; that means it can change any time. - * - * ```ts - * console.log(Deno.resources()); - * // { 0: "stdin", 1: "stdout", 2: "stderr" } - * Deno.openSync('../test.file'); - * console.log(Deno.resources()); - * // { 0: "stdin", 1: "stdout", 2: "stderr", 3: "fsFile" } - * ``` - */ - export function resources(): ResourceMap; - - /** - * Additional information for FsEvent objects with the "other" kind. - * - * - "rescan": rescan notices indicate either a lapse in the events or a - * change in the filesystem such that events received so far can no longer - * be relied on to represent the state of the filesystem now. An - * application that simply reacts to file changes may not care about this. - * An application that keeps an in-memory representation of the filesystem - * will need to care, and will need to refresh that representation directly - * from the filesystem. - */ - export type FsEventFlag = "rescan"; - - export interface FsEvent { - kind: "any" | "access" | "create" | "modify" | "remove" | "other"; - paths: string[]; - flag?: FsEventFlag; - } - - /** - * FsWatcher is returned by `Deno.watchFs` function when you start watching - * the file system. You can iterate over this interface to get the file - * system events, and also you can stop watching the file system by calling - * `.close()` method. - */ - export interface FsWatcher extends AsyncIterable { - /** The resource id of the `FsWatcher`. */ - readonly rid: number; - /** Stops watching the file system and closes the watcher resource. */ - close(): void; - /** - * Stops watching the file system and closes the watcher resource. - * - * @deprecated Will be removed at 2.0. - */ - return?(value?: any): Promise>; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - /** Watch for file system events against one or more `paths`, which can be files - * or directories. These paths must exist already. One user action (e.g. - * `touch test.file`) can generate multiple file system events. Likewise, - * one user action can result in multiple file paths in one event (e.g. `mv - * old_name.txt new_name.txt`). Recursive option is `true` by default and, - * for directories, will watch the specified directory and all sub directories. - * Note that the exact ordering of the events can vary between operating systems. - * - * ```ts - * const watcher = Deno.watchFs("/"); - * for await (const event of watcher) { - * console.log(">>>> event", event); - * // { kind: "create", paths: [ "/foo.txt" ] } - * } - * ``` - * - * Requires `allow-read` permission. - * - * Call `watcher.close()` to stop watching. - * - * ```ts - * const watcher = Deno.watchFs("/"); - * - * setTimeout(() => { - * watcher.close(); - * }, 5000); - * - * for await (const event of watcher) { - * console.log(">>>> event", event); - * } - * ``` - */ - export function watchFs( - paths: string | string[], - options?: { recursive: boolean }, - ): FsWatcher; - - export class Process { - readonly rid: number; - readonly pid: number; - readonly stdin: T["stdin"] extends "piped" ? Writer & Closer & { - writable: WritableStream; - } - : (Writer & Closer & { writable: WritableStream }) | null; - readonly stdout: T["stdout"] extends "piped" ? Reader & Closer & { - readable: ReadableStream; - } - : (Reader & Closer & { readable: ReadableStream }) | null; - readonly stderr: T["stderr"] extends "piped" ? Reader & Closer & { - readable: ReadableStream; - } - : (Reader & Closer & { readable: ReadableStream }) | null; - /** Wait for the process to exit and return its exit status. - * - * Calling this function multiple times will return the same status. - * - * Stdin handle to the process will be closed before waiting to avoid - * a deadlock. - * - * If `stdout` and/or `stderr` were set to `"piped"`, they must be closed - * manually before the process can exit. - * - * To run process to completion and collect output from both `stdout` and - * `stderr` use: - * - * ```ts - * const p = Deno.run({ cmd: [ "echo", "hello world" ], stderr: 'piped', stdout: 'piped' }); - * const [status, stdout, stderr] = await Promise.all([ - * p.status(), - * p.output(), - * p.stderrOutput() - * ]); - * p.close(); - * ``` - */ - status(): Promise; - /** Buffer the stdout until EOF and return it as `Uint8Array`. - * - * You must set stdout to `"piped"` when creating the process. - * - * This calls `close()` on stdout after its done. */ - output(): Promise; - /** Buffer the stderr until EOF and return it as `Uint8Array`. - * - * You must set stderr to `"piped"` when creating the process. - * - * This calls `close()` on stderr after its done. */ - stderrOutput(): Promise; - close(): void; - - /** Send a signal to process. - * - * ```ts - * const p = Deno.run({ cmd: [ "sleep", "20" ]}); - * p.kill("SIGTERM"); - * p.close(); - * ``` - */ - kill(signo: Signal): void; - } - - export type Signal = - | "SIGABRT" - | "SIGALRM" - | "SIGBREAK" - | "SIGBUS" - | "SIGCHLD" - | "SIGCONT" - | "SIGEMT" - | "SIGFPE" - | "SIGHUP" - | "SIGILL" - | "SIGINFO" - | "SIGINT" - | "SIGIO" - | "SIGKILL" - | "SIGPIPE" - | "SIGPROF" - | "SIGPWR" - | "SIGQUIT" - | "SIGSEGV" - | "SIGSTKFLT" - | "SIGSTOP" - | "SIGSYS" - | "SIGTERM" - | "SIGTRAP" - | "SIGTSTP" - | "SIGTTIN" - | "SIGTTOU" - | "SIGURG" - | "SIGUSR1" - | "SIGUSR2" - | "SIGVTALRM" - | "SIGWINCH" - | "SIGXCPU" - | "SIGXFSZ"; - - /** Registers the given function as a listener of the given signal event. - * - * ```ts - * Deno.addSignalListener("SIGTERM", () => { - * console.log("SIGTERM!") - * }); - * ``` - * - * NOTE: On Windows only SIGINT (ctrl+c) and SIGBREAK (ctrl+break) are supported. - */ - export function addSignalListener(signal: Signal, handler: () => void): void; - - /** Removes the given signal listener that has been registered with - * Deno.addSignalListener. - * - * ```ts - * const listener = () => { - * console.log("SIGTERM!") - * }; - * Deno.addSignalListener("SIGTERM", listener); - * Deno.removeSignalListener("SIGTERM", listener); - * ``` - * - * NOTE: On Windows only SIGINT (ctrl+c) and SIGBREAK (ctrl+break) are supported. - */ - export function removeSignalListener( - signal: Signal, - handler: () => void, - ): void; - - export type ProcessStatus = - | { - success: true; - code: 0; - signal?: undefined; - } - | { - success: false; - code: number; - signal?: number; - }; - - export interface RunOptions { - /** Arguments to pass. Note, the first element needs to be a path to the - * binary */ - cmd: readonly string[] | [URL, ...string[]]; - cwd?: string; - env?: { - [key: string]: string; - }; - stdout?: "inherit" | "piped" | "null" | number; - stderr?: "inherit" | "piped" | "null" | number; - stdin?: "inherit" | "piped" | "null" | number; - } - - /** Spawns new subprocess. RunOptions must contain at a minimum the `opt.cmd`, - * an array of program arguments, the first of which is the binary. - * - * ```ts - * const p = Deno.run({ - * cmd: ["curl", "https://example.com"], - * }); - * const status = await p.status(); - * ``` - * - * Subprocess uses same working directory as parent process unless `opt.cwd` - * is specified. - * - * Environmental variables from parent process can be cleared using `opt.clearEnv`. - * Doesn't guarantee that only `opt.env` variables are present, - * as the OS may set environmental variables for processes. - * - * Environmental variables for subprocess can be specified using `opt.env` - * mapping. - * - * `opt.uid` sets the child process’s user ID. This translates to a setuid call - * in the child process. Failure in the setuid call will cause the spawn to fail. - * - * `opt.gid` is similar to `opt.uid`, but sets the group ID of the child process. - * This has the same semantics as the uid field. - * - * By default subprocess inherits stdio of parent process. To change that - * `opt.stdout`, `opt.stderr` and `opt.stdin` can be specified independently - - * they can be set to either an rid of open file or set to "inherit" "piped" - * or "null": - * - * `"inherit"` The default if unspecified. The child inherits from the - * corresponding parent descriptor. - * - * `"piped"` A new pipe should be arranged to connect the parent and child - * sub-processes. - * - * `"null"` This stream will be ignored. This is the equivalent of attaching - * the stream to `/dev/null`. - * - * Details of the spawned process are returned. - * - * Requires `allow-run` permission. */ - export function run(opt: T): Process; - - export interface InspectOptions { - /** Stylize output with ANSI colors. Defaults to false. */ - colors?: boolean; - /** Try to fit more than one entry of a collection on the same line. - * Defaults to true. */ - compact?: boolean; - /** Traversal depth for nested objects. Defaults to 4. */ - depth?: number; - /** The maximum number of iterable entries to print. Defaults to 100. */ - iterableLimit?: number; - /** Show a Proxy's target and handler. Defaults to false. */ - showProxy?: boolean; - /** Sort Object, Set and Map entries by key. Defaults to false. */ - sorted?: boolean; - /** Add a trailing comma for multiline collections. Defaults to false. */ - trailingComma?: boolean; - /*** Evaluate the result of calling getters. Defaults to false. */ - getters?: boolean; - /** Show an object's non-enumerable properties. Defaults to false. */ - showHidden?: boolean; - /** The maximum length of a string before it is truncated with an ellipsis */ - strAbbreviateSize?: number; - } - - /** Converts the input into a string that has the same format as printed by - * `console.log()`. - * - * ```ts - * const obj = { - * a: 10, - * b: "hello", - * }; - * const objAsString = Deno.inspect(obj); // { a: 10, b: "hello" } - * console.log(obj); // prints same value as objAsString, e.g. { a: 10, b: "hello" } - * ``` - * - * You can also register custom inspect functions, via the symbol `Symbol.for("Deno.customInspect")`, - * on objects, to control and customize the output. - * - * ```ts - * class A { - * x = 10; - * y = "hello"; - * [Symbol.for("Deno.customInspect")](): string { - * return "x=" + this.x + ", y=" + this.y; - * } - * } - * - * const inStringFormat = Deno.inspect(new A()); // "x=10, y=hello" - * console.log(inStringFormat); // prints "x=10, y=hello" - * ``` - * - * Finally, you can also specify the depth to which it will format. - * - * ```ts - * Deno.inspect({a: {b: {c: {d: 'hello'}}}}, {depth: 2}); // { a: { b: [Object] } } - * ``` - */ - export function inspect(value: unknown, options?: InspectOptions): string; - - /** The name of a "powerful feature" which needs permission. */ - export type PermissionName = - | "run" - | "read" - | "write" - | "net" - | "env" - | "ffi" - | "hrtime"; - - /** The current status of the permission. */ - export type PermissionState = "granted" | "denied" | "prompt"; - - export interface RunPermissionDescriptor { - name: "run"; - command?: string | URL; - } - - export interface ReadPermissionDescriptor { - name: "read"; - path?: string | URL; - } - - export interface WritePermissionDescriptor { - name: "write"; - path?: string | URL; - } - - export interface NetPermissionDescriptor { - name: "net"; - /** Optional host string of the form `"[:]"`. Examples: - * - * "github.com" - * "deno.land:8080" - */ - host?: string; - } - - export interface EnvPermissionDescriptor { - name: "env"; - variable?: string; - } - - export interface FfiPermissionDescriptor { - name: "ffi"; - path?: string | URL; - } - - export interface HrtimePermissionDescriptor { - name: "hrtime"; - } - - /** Permission descriptors which define a permission and can be queried, - * requested, or revoked. */ - export type PermissionDescriptor = - | RunPermissionDescriptor - | ReadPermissionDescriptor - | WritePermissionDescriptor - | NetPermissionDescriptor - | EnvPermissionDescriptor - | FfiPermissionDescriptor - | HrtimePermissionDescriptor; - - export interface PermissionStatusEventMap { - "change": Event; - } - - export class PermissionStatus extends EventTarget { - // deno-lint-ignore no-explicit-any - onchange: ((this: PermissionStatus, ev: Event) => any) | null; - readonly state: PermissionState; - addEventListener( - type: K, - listener: ( - this: PermissionStatus, - ev: PermissionStatusEventMap[K], - ) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: ( - this: PermissionStatus, - ev: PermissionStatusEventMap[K], - ) => any, - options?: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; - } - - export class Permissions { - /** Resolves to the current status of a permission. - * - * ```ts - * const status = await Deno.permissions.query({ name: "read", path: "/etc" }); - * console.log(status.state); - * ``` - */ - query(desc: PermissionDescriptor): Promise; - - /** Revokes a permission, and resolves to the state of the permission. - * - * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; - * - * const status = await Deno.permissions.revoke({ name: "run" }); - * assert(status.state !== "granted") - * ``` - */ - revoke(desc: PermissionDescriptor): Promise; - - /** Requests the permission, and resolves to the state of the permission. - * - * ```ts - * const status = await Deno.permissions.request({ name: "env" }); - * if (status.state === "granted") { - * console.log("'env' permission is granted."); - * } else { - * console.log("'env' permission is denied."); - * } - * ``` - */ - request(desc: PermissionDescriptor): Promise; - } - - /** Deno's permission management API. */ - export const permissions: Permissions; - - /** Build related information. */ - export const build: { - /** The LLVM target triple */ - target: string; - /** Instruction set architecture */ - arch: "x86_64" | "aarch64"; - /** Operating system */ - os: "darwin" | "linux" | "windows"; - /** Computer vendor */ - vendor: string; - /** Optional environment */ - env?: string; - }; - - /** Version related information. */ - export const version: { - /** Deno's version. For example: `"1.0.0"` */ - deno: string; - /** The V8 version used by Deno. For example: `"8.0.0.0"` */ - v8: string; - /** The TypeScript version used by Deno. For example: `"4.0.0"` */ - typescript: string; - }; - - /** Returns the script arguments to the program. If for example we run a - * program: - * - * deno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd - * - * Then `Deno.args` will contain: - * - * [ "/etc/passwd" ] - */ - export const args: string[]; - - /** - * A symbol which can be used as a key for a custom method which will be - * called when `Deno.inspect()` is called, or when the object is logged to - * the console. - * - * @deprecated This symbol is deprecated since 1.9. Use - * `Symbol.for("Deno.customInspect")` instead. - */ - export const customInspect: unique symbol; - - /** The URL of the entrypoint module entered from the command-line. */ - export const mainModule: string; - - export type SymlinkOptions = { - type: "file" | "dir"; - }; - - /** - * Creates `newpath` as a symbolic link to `oldpath`. - * - * The options.type parameter can be set to `file` or `dir`. This argument is only - * available on Windows and ignored on other platforms. - * - * ```ts - * Deno.symlinkSync("old/name", "new/name"); - * ``` - * - * Requires full `allow-read` and `allow-write` permissions. */ - export function symlinkSync( - oldpath: string | URL, - newpath: string | URL, - options?: SymlinkOptions, - ): void; - - /** - * Creates `newpath` as a symbolic link to `oldpath`. - * - * The options.type parameter can be set to `file` or `dir`. This argument is only - * available on Windows and ignored on other platforms. - * - * ```ts - * await Deno.symlink("old/name", "new/name"); - * ``` - * - * Requires full `allow-read` and `allow-write` permissions. */ - export function symlink( - oldpath: string | URL, - newpath: string | URL, - options?: SymlinkOptions, - ): Promise; - - /** - * Synchronously truncates or extends the specified file stream, to reach the - * specified `len`. - * - * If `len` is not specified then the entire file contents are truncated as if len was set to 0. - * - * if the file previously was larger than this new length, the extra data is lost. - * - * if the file previously was shorter, it is extended, and the extended part reads as null bytes ('\0'). - * - * ```ts - * // truncate the entire file - * const file = Deno.openSync("my_file.txt", { read: true, write: true, truncate: true, create: true }); - * Deno.ftruncateSync(file.rid); - * ``` - * - * ```ts - * // truncate part of the file - * const file = Deno.openSync("my_file.txt", { read: true, write: true, create: true }); - * Deno.writeSync(file.rid, new TextEncoder().encode("Hello World")); - * Deno.ftruncateSync(file.rid, 7); - * Deno.seekSync(file.rid, 0, Deno.SeekMode.Start); - * const data = new Uint8Array(32); - * Deno.readSync(file.rid, data); - * console.log(new TextDecoder().decode(data)); // Hello W - * ``` - */ - export function ftruncateSync(rid: number, len?: number): void; - - /** - * Truncates or extends the specified file stream, to reach the specified `len`. - * - * If `len` is not specified then the entire file contents are truncated as if len was set to 0. - * - * If the file previously was larger than this new length, the extra data is lost. - * - * If the file previously was shorter, it is extended, and the extended part reads as null bytes ('\0'). - * - * ```ts - * // truncate the entire file - * const file = await Deno.open("my_file.txt", { read: true, write: true, create: true }); - * await Deno.ftruncate(file.rid); - * ``` - * - * ```ts - * // truncate part of the file - * const file = await Deno.open("my_file.txt", { read: true, write: true, create: true }); - * await Deno.write(file.rid, new TextEncoder().encode("Hello World")); - * await Deno.ftruncate(file.rid, 7); - * const data = new Uint8Array(32); - * await Deno.read(file.rid, data); - * console.log(new TextDecoder().decode(data)); // Hello W - * ``` - */ - export function ftruncate(rid: number, len?: number): Promise; - - /** - * Synchronously returns a `Deno.FileInfo` for the given file stream. - * - * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; - * const file = Deno.openSync("file.txt", { read: true }); - * const fileInfo = Deno.fstatSync(file.rid); - * assert(fileInfo.isFile); - * ``` - */ - export function fstatSync(rid: number): FileInfo; - - /** - * Returns a `Deno.FileInfo` for the given file stream. - * - * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; - * const file = await Deno.open("file.txt", { read: true }); - * const fileInfo = await Deno.fstat(file.rid); - * assert(fileInfo.isFile); - * ``` - */ - export function fstat(rid: number): Promise; - - export interface RequestEvent { - readonly request: Request; - respondWith(r: Response | Promise): Promise; - } - - export interface HttpConn extends AsyncIterable { - readonly rid: number; - - nextRequest(): Promise; - close(): void; - } - - /** - * Services HTTP requests given a TCP or TLS socket. - * - * ```ts - * const conn = Deno.listen({ port: 80 }); - * const httpConn = Deno.serveHttp(await conn.accept()); - * const e = await httpConn.nextRequest(); - * if (e) { - * e.respondWith(new Response("Hello World")); - * } - * ``` - * - * If `httpConn.nextRequest()` encounters an error or returns `null` - * then the underlying HttpConn resource is closed automatically. - * - * Alternatively, you can also use the Async Iterator approach: - * - * ```ts - * async function handleHttp(conn: Deno.Conn) { - * for await (const e of Deno.serveHttp(conn)) { - * e.respondWith(new Response("Hello World")); - * } - * } - * - * for await (const conn of Deno.listen({ port: 80 })) { - * handleHttp(conn); - * } - * ``` - */ - export function serveHttp(conn: Conn): HttpConn; - - export interface WebSocketUpgrade { - response: Response; - socket: WebSocket; - } - - export interface UpgradeWebSocketOptions { - protocol?: string; - /** - * If the client does not respond to this frame with a - * `pong` within the timeout specified, the connection is deemed - * unhealthy and is closed. The `close` and `error` event will be emitted. - * - * The default is 120 seconds. Set to 0 to disable timeouts. - */ - idleTimeout?: number; - } - - /** - * Used to upgrade an incoming HTTP request to a WebSocket. - * - * Given a request, returns a pair of WebSocket and Response. The original - * request must be responded to with the returned response for the websocket - * upgrade to be successful. - * - * ```ts - * const conn = Deno.listen({ port: 80 }); - * const httpConn = Deno.serveHttp(await conn.accept()); - * const e = await httpConn.nextRequest(); - * if (e) { - * const { socket, response } = Deno.upgradeWebSocket(e.request); - * socket.onopen = () => { - * socket.send("Hello World!"); - * }; - * socket.onmessage = (e) => { - * console.log(e.data); - * socket.close(); - * }; - * socket.onclose = () => console.log("WebSocket has been closed."); - * socket.onerror = (e) => console.error("WebSocket error:", e); - * e.respondWith(response); - * } - * ``` - * - * If the request body is disturbed (read from) before the upgrade is - * completed, upgrading fails. - * - * This operation does not yet consume the request or open the websocket. This - * only happens once the returned response has been passed to `respondWith`. - */ - export function upgradeWebSocket( - request: Request, - options?: UpgradeWebSocketOptions, - ): WebSocketUpgrade; - - /** Send a signal to process under given `pid`. - * - * If `pid` is negative, the signal will be sent to the process group - * identified by `pid`. An error will be thrown if a negative - * `pid` is used on Windows. - * - * ```ts - * const p = Deno.run({ - * cmd: ["sleep", "10000"] - * }); - * - * Deno.kill(p.pid, "SIGINT"); - * ``` - * - * Requires `allow-run` permission. */ - export function kill(pid: number, signo: Signal): void; - - /** The type of the resource record. - * Only the listed types are supported currently. */ - export type RecordType = - | "A" - | "AAAA" - | "ANAME" - | "CAA" - | "CNAME" - | "MX" - | "NAPTR" - | "NS" - | "PTR" - | "SOA" - | "SRV" - | "TXT"; - - export interface ResolveDnsOptions { - /** The name server to be used for lookups. - * If not specified, defaults to the system configuration e.g. `/etc/resolv.conf` on Unix. */ - nameServer?: { - /** The IP address of the name server */ - ipAddr: string; - /** The port number the query will be sent to. - * If not specified, defaults to 53. */ - port?: number; - }; - } - - /** If `resolveDns` is called with "CAA" record type specified, it will return an array of this interface. */ - export interface CAARecord { - critical: boolean; - tag: string; - value: string; - } - - /** If `resolveDns` is called with "MX" record type specified, it will return an array of this interface. */ - export interface MXRecord { - preference: number; - exchange: string; - } - - /** If `resolveDns` is called with "NAPTR" record type specified, it will return an array of this interface. */ - export interface NAPTRRecord { - order: number; - preference: number; - flags: string; - services: string; - regexp: string; - replacement: string; - } - - /** If `resolveDns` is called with "SOA" record type specified, it will return an array of this interface. */ - export interface SOARecord { - mname: string; - rname: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minimum: number; - } - - /** If `resolveDns` is called with "SRV" record type specified, it will return an array of this interface. */ - export interface SRVRecord { - priority: number; - weight: number; - port: number; - target: string; - } - - export function resolveDns( - query: string, - recordType: "A" | "AAAA" | "ANAME" | "CNAME" | "NS" | "PTR", - options?: ResolveDnsOptions, - ): Promise; - - export function resolveDns( - query: string, - recordType: "CAA", - options?: ResolveDnsOptions, - ): Promise; - - export function resolveDns( - query: string, - recordType: "MX", - options?: ResolveDnsOptions, - ): Promise; - - export function resolveDns( - query: string, - recordType: "NAPTR", - options?: ResolveDnsOptions, - ): Promise; - - export function resolveDns( - query: string, - recordType: "SOA", - options?: ResolveDnsOptions, - ): Promise; - - export function resolveDns( - query: string, - recordType: "SRV", - options?: ResolveDnsOptions, - ): Promise; - - export function resolveDns( - query: string, - recordType: "TXT", - options?: ResolveDnsOptions, - ): Promise; - - /** - * Performs DNS resolution against the given query, returning resolved records. - * Fails in the cases such as: - * - the query is in invalid format - * - the options have an invalid parameter, e.g. `nameServer.port` is beyond the range of 16-bit unsigned integer - * - timed out - * - * ```ts - * const a = await Deno.resolveDns("example.com", "A"); - * - * const aaaa = await Deno.resolveDns("example.com", "AAAA", { - * nameServer: { ipAddr: "8.8.8.8", port: 53 }, - * }); - * ``` - * - * Requires `allow-net` permission. - */ - export function resolveDns( - query: string, - recordType: RecordType, - options?: ResolveDnsOptions, - ): Promise< - | string[] - | CAARecord[] - | MXRecord[] - | NAPTRRecord[] - | SOARecord[] - | SRVRecord[] - | string[][] - >; -} diff --git a/components/clarinet-cli/dts/lib.deno.shared_globals.d.ts b/components/clarinet-cli/dts/lib.deno.shared_globals.d.ts deleted file mode 100644 index abf5e41fb..000000000 --- a/components/clarinet-cli/dts/lib.deno.shared_globals.d.ts +++ /dev/null @@ -1,582 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -// Documentation partially adapted from [MDN](https://developer.mozilla.org/), -// by Mozilla Contributors, which is licensed under CC-BY-SA 2.5. - -/// -/// -/// -/// -/// -/// -/// -/// -/// - -declare namespace WebAssembly { - /** - * The `WebAssembly.CompileError` object indicates an error during WebAssembly decoding or validation. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError) - */ - export class CompileError extends Error { - /** Creates a new `WebAssembly.CompileError` object. */ - constructor(message?: string, options?: ErrorOptions); - } - - /** - * A `WebAssembly.Global` object represents a global variable instance, accessible from - * both JavaScript and importable/exportable across one or more `WebAssembly.Module` - * instances. This allows dynamic linking of multiple modules. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) - */ - export class Global { - /** Creates a new `Global` object. */ - constructor(descriptor: GlobalDescriptor, v?: any); - - /** - * The value contained inside the global variable — this can be used to directly set - * and get the global's value. - */ - value: any; - - /** Old-style method that returns the value contained inside the global variable. */ - valueOf(): any; - } - - /** - * A `WebAssembly.Instance` object is a stateful, executable instance of a `WebAssembly.Module`. - * Instance objects contain all the Exported WebAssembly functions that allow calling into - * WebAssembly code from JavaScript. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) - */ - export class Instance { - /** Creates a new Instance object. */ - constructor(module: Module, importObject?: Imports); - - /** - * Returns an object containing as its members all the functions exported from the - * WebAssembly module instance, to allow them to be accessed and used by JavaScript. - * Read-only. - */ - readonly exports: Exports; - } - - /** - * The `WebAssembly.LinkError` object indicates an error during module instantiation - * (besides traps from the start function). - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError) - */ - export class LinkError extends Error { - /** Creates a new WebAssembly.LinkError object. */ - constructor(message?: string, options?: ErrorOptions); - } - - /** - * The `WebAssembly.Memory` object is a resizable `ArrayBuffer` or `SharedArrayBuffer` that - * holds the raw bytes of memory accessed by a WebAssembly Instance. - * - * A memory created by JavaScript or in WebAssembly code will be accessible and mutable - * from both JavaScript and WebAssembly. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) - */ - export class Memory { - /** Creates a new `Memory` object. */ - constructor(descriptor: MemoryDescriptor); - - /** An accessor property that returns the buffer contained in the memory. */ - readonly buffer: ArrayBuffer | SharedArrayBuffer; - - /** - * Increases the size of the memory instance by a specified number of WebAssembly - * pages (each one is 64KB in size). - */ - grow(delta: number): number; - } - - /** - * A `WebAssembly.Module` object contains stateless WebAssembly code that has already been compiled - * by the browser — this can be efficiently shared with Workers, and instantiated multiple times. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) - */ - export class Module { - /** Creates a new `Module` object. */ - constructor(bytes: BufferSource); - - /** - * Given a `Module` and string, returns a copy of the contents of all custom sections in the - * module with the given string name. - */ - static customSections( - moduleObject: Module, - sectionName: string, - ): ArrayBuffer[]; - - /** Given a `Module`, returns an array containing descriptions of all the declared exports. */ - static exports(moduleObject: Module): ModuleExportDescriptor[]; - - /** Given a `Module`, returns an array containing descriptions of all the declared imports. */ - static imports(moduleObject: Module): ModuleImportDescriptor[]; - } - - /** - * The `WebAssembly.RuntimeError` object is the error type that is thrown whenever WebAssembly - * specifies a trap. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError) - */ - export class RuntimeError extends Error { - /** Creates a new `WebAssembly.RuntimeError` object. */ - constructor(message?: string, options?: ErrorOptions); - } - - /** - * The `WebAssembly.Table()` object is a JavaScript wrapper object — an array-like structure - * representing a WebAssembly Table, which stores function references. A table created by - * JavaScript or in WebAssembly code will be accessible and mutable from both JavaScript - * and WebAssembly. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table) - */ - export class Table { - /** Creates a new `Table` object. */ - constructor(descriptor: TableDescriptor); - - /** Returns the length of the table, i.e. the number of elements. */ - readonly length: number; - - /** Accessor function — gets the element stored at a given index. */ - get(index: number): Function | null; - - /** Increases the size of the `Table` instance by a specified number of elements. */ - grow(delta: number): number; - - /** Sets an element stored at a given index to a given value. */ - set(index: number, value: Function | null): void; - } - - /** The `GlobalDescriptor` describes the options you can pass to `new WebAssembly.Global()`. */ - export interface GlobalDescriptor { - mutable?: boolean; - value: ValueType; - } - - /** The `MemoryDescriptor` describes the options you can pass to `new WebAssembly.Memory()`. */ - export interface MemoryDescriptor { - initial: number; - maximum?: number; - shared?: boolean; - } - - /** A `ModuleExportDescriptor` is the description of a declared export in a `WebAssembly.Module`. */ - export interface ModuleExportDescriptor { - kind: ImportExportKind; - name: string; - } - - /** A `ModuleImportDescriptor` is the description of a declared import in a `WebAssembly.Module`. */ - export interface ModuleImportDescriptor { - kind: ImportExportKind; - module: string; - name: string; - } - - /** The `TableDescriptor` describes the options you can pass to `new WebAssembly.Table()`. */ - export interface TableDescriptor { - element: TableKind; - initial: number; - maximum?: number; - } - - /** The value returned from `WebAssembly.instantiate`. */ - export interface WebAssemblyInstantiatedSource { - /* A `WebAssembly.Instance` object that contains all the exported WebAssembly functions. */ - instance: Instance; - - /** - * A `WebAssembly.Module` object representing the compiled WebAssembly module. - * This `Module` can be instantiated again, or shared via postMessage(). - */ - module: Module; - } - - export type ImportExportKind = "function" | "global" | "memory" | "table"; - export type TableKind = "anyfunc"; - export type ValueType = "f32" | "f64" | "i32" | "i64"; - export type ExportValue = Function | Global | Memory | Table; - export type Exports = Record; - export type ImportValue = ExportValue | number; - export type ModuleImports = Record; - export type Imports = Record; - - /** - * The `WebAssembly.compile()` function compiles WebAssembly binary code into a - * `WebAssembly.Module` object. This function is useful if it is necessary to compile - * a module before it can be instantiated (otherwise, the `WebAssembly.instantiate()` - * function should be used). - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile) - */ - export function compile(bytes: BufferSource): Promise; - - /** - * The `WebAssembly.compileStreaming()` function compiles a `WebAssembly.Module` - * directly from a streamed underlying source. This function is useful if it is - * necessary to a compile a module before it can be instantiated (otherwise, the - * `WebAssembly.instantiateStreaming()` function should be used). - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) - */ - export function compileStreaming( - source: Response | Promise, - ): Promise; - - /** - * The WebAssembly.instantiate() function allows you to compile and instantiate - * WebAssembly code. - * - * This overload takes the WebAssembly binary code, in the form of a typed - * array or ArrayBuffer, and performs both compilation and instantiation in one step. - * The returned Promise resolves to both a compiled WebAssembly.Module and its first - * WebAssembly.Instance. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) - */ - export function instantiate( - bytes: BufferSource, - importObject?: Imports, - ): Promise; - - /** - * The WebAssembly.instantiate() function allows you to compile and instantiate - * WebAssembly code. - * - * This overload takes an already-compiled WebAssembly.Module and returns - * a Promise that resolves to an Instance of that Module. This overload is useful - * if the Module has already been compiled. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) - */ - export function instantiate( - moduleObject: Module, - importObject?: Imports, - ): Promise; - - /** - * The `WebAssembly.instantiateStreaming()` function compiles and instantiates a - * WebAssembly module directly from a streamed underlying source. This is the most - * efficient, optimized way to load wasm code. - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming) - */ - export function instantiateStreaming( - response: Response | PromiseLike, - importObject?: Imports, - ): Promise; - - /** - * The `WebAssembly.validate()` function validates a given typed array of - * WebAssembly binary code, returning whether the bytes form a valid wasm - * module (`true`) or not (`false`). - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate) - */ - export function validate(bytes: BufferSource): boolean; -} - -/** Sets a timer which executes a function once after the timer expires. Returns - * an id which may be used to cancel the timeout. - * - * ```ts - * setTimeout(() => { console.log('hello'); }, 500); - * ``` - */ -declare function setTimeout( - /** callback function to execute when timer expires */ - cb: (...args: any[]) => void, - /** delay in ms */ - delay?: number, - /** arguments passed to callback function */ - ...args: any[] -): number; - -/** Repeatedly calls a function , with a fixed time delay between each call. - * - * ```ts - * // Outputs 'hello' to the console every 500ms - * setInterval(() => { console.log('hello'); }, 500); - * ``` - */ -declare function setInterval( - /** callback function to execute when timer expires */ - cb: (...args: any[]) => void, - /** delay in ms */ - delay?: number, - /** arguments passed to callback function */ - ...args: any[] -): number; - -/** Cancels a timed, repeating action which was previously started by a call - * to `setInterval()` - * - * ```ts - * const id = setInterval(() => {console.log('hello');}, 500); - * // ... - * clearInterval(id); - * ``` - */ -declare function clearInterval(id?: number): void; - -/** Cancels a scheduled action initiated by `setTimeout()` - * - * ```ts - * const id = setTimeout(() => {console.log('hello');}, 500); - * // ... - * clearTimeout(id); - * ``` - */ -declare function clearTimeout(id?: number): void; - -interface VoidFunction { - (): void; -} - -/** A microtask is a short function which is executed after the function or - * module which created it exits and only if the JavaScript execution stack is - * empty, but before returning control to the event loop being used to drive the - * script's execution environment. This event loop may be either the main event - * loop or the event loop driving a web worker. - * - * ```ts - * queueMicrotask(() => { console.log('This event loop stack is complete'); }); - * ``` - */ -declare function queueMicrotask(func: VoidFunction): void; - -/** Dispatches an event in the global scope, synchronously invoking any - * registered event listeners for this event in the appropriate order. Returns - * false if event is cancelable and at least one of the event handlers which - * handled this event called Event.preventDefault(). Otherwise it returns true. - * - * ```ts - * dispatchEvent(new Event('unload')); - * ``` - */ -declare function dispatchEvent(event: Event): boolean; - -interface DOMStringList { - /** Returns the number of strings in strings. */ - readonly length: number; - /** Returns true if strings contains string, and false otherwise. */ - contains(string: string): boolean; - /** Returns the string with index index from strings. */ - item(index: number): string | null; - [index: number]: string; -} - -type BufferSource = ArrayBufferView | ArrayBuffer; - -declare var console: Console; - -interface ErrorEventInit extends EventInit { - message?: string; - filename?: string; - lineno?: number; - colno?: number; - error?: any; -} - -declare class ErrorEvent extends Event { - readonly message: string; - readonly filename: string; - readonly lineno: number; - readonly colno: number; - readonly error: any; - constructor(type: string, eventInitDict?: ErrorEventInit); -} - -interface PromiseRejectionEventInit extends EventInit { - promise: Promise; - reason?: any; -} - -declare class PromiseRejectionEvent extends Event { - readonly promise: Promise; - readonly reason: any; - constructor(type: string, eventInitDict?: PromiseRejectionEventInit); -} - -interface AbstractWorkerEventMap { - "error": ErrorEvent; -} - -interface WorkerEventMap extends AbstractWorkerEventMap { - "message": MessageEvent; - "messageerror": MessageEvent; -} - -interface WorkerOptions { - type?: "classic" | "module"; - name?: string; -} - -declare class Worker extends EventTarget { - onerror?: (e: ErrorEvent) => void; - onmessage?: (e: MessageEvent) => void; - onmessageerror?: (e: MessageEvent) => void; - constructor( - specifier: string | URL, - options?: WorkerOptions, - ); - postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: StructuredSerializeOptions): void; - addEventListener( - type: K, - listener: (this: Worker, ev: WorkerEventMap[K]) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: (this: Worker, ev: WorkerEventMap[K]) => any, - options?: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; - terminate(): void; -} - -declare type PerformanceEntryList = PerformanceEntry[]; - -declare class Performance extends EventTarget { - /** Returns a timestamp representing the start of the performance measurement. */ - readonly timeOrigin: number; - constructor(); - - /** Removes the stored timestamp with the associated name. */ - clearMarks(markName?: string): void; - - /** Removes stored timestamp with the associated name. */ - clearMeasures(measureName?: string): void; - - getEntries(): PerformanceEntryList; - getEntriesByName(name: string, type?: string): PerformanceEntryList; - getEntriesByType(type: string): PerformanceEntryList; - - /** Stores a timestamp with the associated name (a "mark"). */ - mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark; - - /** Stores the `DOMHighResTimeStamp` duration between two marks along with the - * associated name (a "measure"). */ - measure( - measureName: string, - options?: PerformanceMeasureOptions, - ): PerformanceMeasure; - /** Stores the `DOMHighResTimeStamp` duration between two marks along with the - * associated name (a "measure"). */ - measure( - measureName: string, - startMark?: string, - endMark?: string, - ): PerformanceMeasure; - - /** Returns a current time from Deno's start in milliseconds. - * - * Use the permission flag `--allow-hrtime` return a precise value. - * - * ```ts - * const t = performance.now(); - * console.log(`${t} ms since start!`); - * ``` - */ - now(): number; - - /** Returns a JSON representation of the performance object. */ - toJSON(): any; -} - -declare var performance: Performance; - -declare interface PerformanceMarkOptions { - /** Metadata to be included in the mark. */ - detail?: any; - - /** Timestamp to be used as the mark time. */ - startTime?: number; -} - -declare interface PerformanceMeasureOptions { - /** Metadata to be included in the measure. */ - detail?: any; - - /** Timestamp to be used as the start time or string to be used as start - * mark. */ - start?: string | number; - - /** Duration between the start and end times. */ - duration?: number; - - /** Timestamp to be used as the end time or string to be used as end mark. */ - end?: string | number; -} - -/** Encapsulates a single performance metric that is part of the performance - * timeline. A performance entry can be directly created by making a performance - * mark or measure (for example by calling the `.mark()` method) at an explicit - * point in an application. */ -declare class PerformanceEntry { - readonly duration: number; - readonly entryType: string; - readonly name: string; - readonly startTime: number; - toJSON(): any; -} - -/** `PerformanceMark` is an abstract interface for `PerformanceEntry` objects - * with an entryType of `"mark"`. Entries of this type are created by calling - * `performance.mark()` to add a named `DOMHighResTimeStamp` (the mark) to the - * performance timeline. */ -declare class PerformanceMark extends PerformanceEntry { - readonly detail: any; - readonly entryType: "mark"; - constructor(name: string, options?: PerformanceMarkOptions); -} - -/** `PerformanceMeasure` is an abstract interface for `PerformanceEntry` objects - * with an entryType of `"measure"`. Entries of this type are created by calling - * `performance.measure()` to add a named `DOMHighResTimeStamp` (the measure) - * between two marks to the performance timeline. */ -declare class PerformanceMeasure extends PerformanceEntry { - readonly detail: any; - readonly entryType: "measure"; -} - -declare interface CustomEventInit extends EventInit { - detail?: T; -} - -declare class CustomEvent extends Event { - constructor(typeArg: string, eventInitDict?: CustomEventInit); - /** Returns any custom data event was created with. Typically used for - * synthetic events. */ - readonly detail: T; -} - -interface ErrorConstructor { - /** See https://v8.dev/docs/stack-trace-api#stack-trace-collection-for-custom-exceptions. */ - captureStackTrace(error: Object, constructor?: Function): void; - // TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this - // internally in a way that makes it unavailable for users. -} diff --git a/components/clarinet-cli/dts/lib.deno.unstable.d.ts b/components/clarinet-cli/dts/lib.deno.unstable.d.ts deleted file mode 100644 index 60637f226..000000000 --- a/components/clarinet-cli/dts/lib.deno.unstable.d.ts +++ /dev/null @@ -1,1331 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -/// -/// - -declare namespace Deno { - export {}; // stop default export type behavior - - export interface BenchDefinition { - fn: () => void | Promise; - name: string; - ignore?: boolean; - /** Group name for the benchmark. - * Grouped benchmarks produce a time summary */ - group?: string; - /** Benchmark should be used as the baseline for other benchmarks - * If there are multiple baselines in a group, the first one is used as the baseline */ - baseline?: boolean; - /** If at least one bench has `only` set to true, only run benches that have - * `only` set to true and fail the bench suite. */ - only?: boolean; - /** Ensure the bench case does not prematurely cause the process to exit, - * for example via a call to `Deno.exit`. Defaults to true. */ - sanitizeExit?: boolean; - - /** Specifies the permissions that should be used to run the bench. - * Set this to "inherit" to keep the calling thread's permissions. - * Set this to "none" to revoke all permissions. - * - * Defaults to "inherit". - */ - permissions?: Deno.PermissionOptions; - } - - /** Register a bench which will be run when `deno bench` is used on the command - * line and the containing module looks like a bench module. - * `fn` can be async if required. - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.bench({ - * name: "example test", - * fn(): void { - * assertEquals("world", "world"); - * }, - * }); - * - * Deno.bench({ - * name: "example ignored test", - * ignore: Deno.build.os === "windows", - * fn(): void { - * // This test is ignored only on Windows machines - * }, - * }); - * - * Deno.bench({ - * name: "example async test", - * async fn() { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * } - * }); - * ``` - */ - export function bench(t: BenchDefinition): void; - - /** Register a bench which will be run when `deno bench` is used on the command - * line and the containing module looks like a bench module. - * `fn` can be async if required. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.bench("My test description", (): void => { - * assertEquals("hello", "hello"); - * }); - * - * Deno.bench("My async test description", async (): Promise => { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function bench( - name: string, - fn: () => void | Promise, - ): void; - - /** Register a bench which will be run when `deno bench` is used on the command - * line and the containing module looks like a bench module. - * `fn` can be async if required. Declared function must have a name. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.bench(function myTestName(): void { - * assertEquals("hello", "hello"); - * }); - * - * Deno.bench(async function myOtherTestName(): Promise { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function bench(fn: () => void | Promise): void; - - /** Register a bench which will be run when `deno bench` is used on the command - * line and the containing module looks like a bench module. - * `fn` can be async if required. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.bench("My test description", { permissions: { read: true } }, (): void => { - * assertEquals("hello", "hello"); - * }); - * - * Deno.bench("My async test description", { permissions: { read: false } }, async (): Promise => { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function bench( - name: string, - options: Omit, - fn: () => void | Promise, - ): void; - - /** Register a bench which will be run when `deno bench` is used on the command - * line and the containing module looks like a bench module. - * `fn` can be async if required. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.bench({ name: "My test description", permissions: { read: true } }, (): void => { - * assertEquals("hello", "hello"); - * }); - * - * Deno.bench({ name: "My async test description", permissions: { read: false } }, async (): Promise => { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function bench( - options: Omit, - fn: () => void | Promise, - ): void; - - /** Register a bench which will be run when `deno bench` is used on the command - * line and the containing module looks like a bench module. - * `fn` can be async if required. Declared function must have a name. - * - * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; - * - * Deno.bench({ permissions: { read: true } }, function myTestName(): void { - * assertEquals("hello", "hello"); - * }); - * - * Deno.bench({ permissions: { read: false } }, async function myOtherTestName(): Promise { - * const decoder = new TextDecoder("utf-8"); - * const data = await Deno.readFile("hello_world.txt"); - * assertEquals(decoder.decode(data), "Hello world"); - * }); - * ``` - */ - export function bench( - options: Omit, - fn: () => void | Promise, - ): void; - - /** - * **UNSTABLE**: New API, yet to be vetted. This API is under consideration to - * determine if permissions are required to call it. - * - * Retrieve the process umask. If `mask` is provided, sets the process umask. - * This call always returns what the umask was before the call. - * - * ```ts - * console.log(Deno.umask()); // e.g. 18 (0o022) - * const prevUmaskValue = Deno.umask(0o077); // e.g. 18 (0o022) - * console.log(Deno.umask()); // e.g. 63 (0o077) - * ``` - * - * NOTE: This API is not implemented on Windows - */ - export function umask(mask?: number): number; - - /** **UNSTABLE**: New API, yet to be vetted. - * - * Gets the size of the console as columns/rows. - * - * ```ts - * const { columns, rows } = Deno.consoleSize(Deno.stdout.rid); - * ``` - */ - export function consoleSize( - rid: number, - ): { - columns: number; - rows: number; - }; - - /** **Unstable** There are questions around which permission this needs. And - * maybe should be renamed (loadAverage?) - * - * Returns an array containing the 1, 5, and 15 minute load averages. The - * load average is a measure of CPU and IO utilization of the last one, five, - * and 15 minute periods expressed as a fractional number. Zero means there - * is no load. On Windows, the three values are always the same and represent - * the current load, not the 1, 5 and 15 minute load averages. - * - * ```ts - * console.log(Deno.loadavg()); // e.g. [ 0.71, 0.44, 0.44 ] - * ``` - * - * Requires `allow-env` permission. - */ - export function loadavg(): number[]; - - /** **Unstable** new API. yet to be vetted. Under consideration to possibly move to - * Deno.build or Deno.versions and if it should depend sys-info, which may not - * be desireable. - * - * Returns the release version of the Operating System. - * - * ```ts - * console.log(Deno.osRelease()); - * ``` - * - * Requires `allow-env` permission. - */ - export function osRelease(): string; - - /** **Unstable** new API. yet to be vetted. - * - * Displays the total amount of free and used physical and swap memory in the - * system, as well as the buffers and caches used by the kernel. - * - * This is similar to the `free` command in Linux - * - * ```ts - * console.log(Deno.systemMemoryInfo()); - * ``` - * - * Requires `allow-env` permission. - */ - export function systemMemoryInfo(): SystemMemoryInfo; - - export interface SystemMemoryInfo { - /** Total installed memory */ - total: number; - /** Unused memory */ - free: number; - /** Estimation of how much memory is available for starting new - * applications, without swapping. Unlike the data provided by the cache or - * free fields, this field takes into account page cache and also that not - * all reclaimable memory slabs will be reclaimed due to items being in use - */ - available: number; - /** Memory used by kernel buffers */ - buffers: number; - /** Memory used by the page cache and slabs */ - cached: number; - /** Total swap memory */ - swapTotal: number; - /** Unused swap memory */ - swapFree: number; - } - - /** The information of the network interface */ - export interface NetworkInterfaceInfo { - /** The network interface name */ - name: string; - /** The IP protocol version */ - family: "IPv4" | "IPv6"; - /** The IP address */ - address: string; - /** The netmask */ - netmask: string; - /** The IPv6 scope id or null */ - scopeid: number | null; - /** The CIDR range */ - cidr: string; - /** The MAC address */ - mac: string; - } - - /** **Unstable** new API. yet to be vetted. - * - * Returns an array of the network interface informations. - * - * ```ts - * console.log(Deno.networkInterfaces()); - * ``` - * - * Requires `allow-env` permission. - */ - export function networkInterfaces(): NetworkInterfaceInfo[]; - - /** **Unstable** new API. yet to be vetted. - * - * Returns the user id of the process on POSIX platforms. Returns null on windows. - * - * ```ts - * console.log(Deno.getUid()); - * ``` - * - * Requires `allow-env` permission. - */ - export function getUid(): number | null; - - /** **Unstable** new API. yet to be vetted. - * - * Returns the group id of the process on POSIX platforms. Returns null on windows. - * - * ```ts - * console.log(Deno.getGid()); - * ``` - * - * Requires `allow-env` permission. - */ - export function getGid(): number | null; - - /** All plain number types for interfacing with foreign functions */ - type NativeNumberType = - | "u8" - | "i8" - | "u16" - | "i16" - | "u32" - | "i32" - | "f32" - | "f64"; - - /** All BigInt number type sfor interfacing with foreign functions */ - type NativeBigIntType = - | "u64" - | "i64" - | "usize" - | "isize"; - - type NativePointerType = "pointer"; - - type NativeFunctionType = "function"; - - type NativeVoidType = "void"; - - /** All possible types for interfacing with foreign functions */ - export type NativeType = - | NativeNumberType - | NativeBigIntType - | NativePointerType - | NativeFunctionType; - - export type NativeResultType = NativeType | NativeVoidType; - - type ToNativeTypeMap = - & Record - & Record - & Record - & Record; - - /** Type conversion for foreign symbol parameters and unsafe callback return types */ - type ToNativeType = ToNativeTypeMap[T]; - - type ToNativeResultTypeMap = ToNativeTypeMap & Record; - - /** Type conversion for unsafe callback return types */ - type ToNativeResultType = - ToNativeResultTypeMap[T]; - - type ToNativeParameterTypes = - // - [(T[number])[]] extends [T] ? ToNativeType[] - : [readonly (T[number])[]] extends [T] - ? readonly ToNativeType[] - : T extends readonly [...NativeType[]] ? { - [K in keyof T]: ToNativeType; - } - : never; - - type FromNativeTypeMap = - & Record - & Record - & Record - & Record; - - /** Type conversion for foreign symbol return types and unsafe callback parameters */ - type FromNativeType = FromNativeTypeMap[T]; - - type FromNativeResultTypeMap = - & FromNativeTypeMap - & Record; - - /** Type conversion for foregin symbol return types */ - type FromNativeResultType = - FromNativeResultTypeMap[T]; - - type FromNativeParameterTypes< - T extends readonly NativeType[], - > = - // - [(T[number])[]] extends [T] ? FromNativeType[] - : [readonly (T[number])[]] extends [T] - ? readonly FromNativeType[] - : T extends readonly [...NativeType[]] ? { - [K in keyof T]: FromNativeType; - } - : never; - - /** A foreign function as defined by its parameter and result types */ - export interface ForeignFunction< - Parameters extends readonly NativeType[] = readonly NativeType[], - Result extends NativeResultType = NativeResultType, - NonBlocking extends boolean = boolean, - > { - /** Name of the symbol, defaults to the key name in symbols object. */ - name?: string; - parameters: Parameters; - result: Result; - /** When true, function calls will run on a dedicated blocking thread and will return a Promise resolving to the `result`. */ - nonblocking?: NonBlocking; - /** When true, function calls can safely callback into JS or trigger a GC event. Default is `false`. */ - callback?: boolean; - } - - export interface ForeignStatic { - /** Name of the symbol, defaults to the key name in symbols object. */ - name?: string; - type: Type; - } - - /** A foreign library interface descriptor */ - export interface ForeignLibraryInterface { - [name: string]: ForeignFunction | ForeignStatic; - } - - /** Infers a foreign symbol */ - type StaticForeignSymbol = - T extends ForeignFunction ? FromForeignFunction - : T extends ForeignStatic ? FromNativeType - : never; - - type FromForeignFunction = T["parameters"] extends - readonly [] ? () => StaticForeignSymbolReturnType - : ( - ...args: ToNativeParameterTypes - ) => StaticForeignSymbolReturnType; - - type StaticForeignSymbolReturnType = - ConditionalAsync>; - - type ConditionalAsync = - IsAsync extends true ? Promise : T; - - /** Infers a foreign library interface */ - type StaticForeignLibraryInterface = { - [K in keyof T]: StaticForeignSymbol; - }; - - type TypedArray = - | Int8Array - | Uint8Array - | Int16Array - | Uint16Array - | Int32Array - | Uint32Array - | Uint8ClampedArray - | Float32Array - | Float64Array - | BigInt64Array - | BigUint64Array; - - /** - * Pointer type depends on the architecture and actual pointer value. - * - * On a 32 bit system all pointer values are plain numbers. On a 64 bit - * system pointer values are represented as numbers if the value is below - * `Number.MAX_SAFE_INTEGER`. - */ - export type PointerValue = number | bigint; - - /** **UNSTABLE**: Unsafe and new API, beware! - * - * An unsafe pointer to a memory location for passing and returning pointers to and from the ffi - */ - export class UnsafePointer { - /** - * Return the direct memory pointer to the typed array in memory - */ - static of(value: Deno.UnsafeCallback | TypedArray): PointerValue; - } - - /** **UNSTABLE**: Unsafe and new API, beware! - * - * An unsafe pointer view to a memory location as specified by the `pointer` - * value. The `UnsafePointerView` API mimics the standard built in interface - * `DataView` for accessing the underlying types at an memory location - * (numbers, strings and raw bytes). - */ - export class UnsafePointerView { - constructor(pointer: bigint); - - pointer: bigint; - - /** Gets an unsigned 8-bit integer at the specified byte offset from the pointer. */ - getUint8(offset?: number): number; - /** Gets a signed 8-bit integer at the specified byte offset from the pointer. */ - getInt8(offset?: number): number; - /** Gets an unsigned 16-bit integer at the specified byte offset from the pointer. */ - getUint16(offset?: number): number; - /** Gets a signed 16-bit integer at the specified byte offset from the pointer. */ - getInt16(offset?: number): number; - /** Gets an unsigned 32-bit integer at the specified byte offset from the pointer. */ - getUint32(offset?: number): number; - /** Gets a signed 32-bit integer at the specified byte offset from the pointer. */ - getInt32(offset?: number): number; - /** Gets an unsigned 64-bit integer at the specified byte offset from the pointer. */ - getBigUint64(offset?: number): PointerValue; - /** Gets a signed 64-bit integer at the specified byte offset from the pointer. */ - getBigInt64(offset?: number): PointerValue; - /** Gets a signed 32-bit float at the specified byte offset from the pointer. */ - getFloat32(offset?: number): number; - /** Gets a signed 64-bit float at the specified byte offset from the pointer. */ - getFloat64(offset?: number): number; - /** Gets a C string (null terminated string) at the specified byte offset from the pointer. */ - getCString(offset?: number): string; - /** Gets a C string (null terminated string) at the specified byte offset from the specified pointer. */ - static getCString(pointer: BigInt, offset?: number): string; - /** Gets an ArrayBuffer of length `byteLength` at the specified byte offset from the pointer. */ - getArrayBuffer(byteLength: number, offset?: number): ArrayBuffer; - /** Gets an ArrayBuffer of length `byteLength` at the specified byte offset from the specified pointer. */ - static getArrayBuffer( - pointer: BigInt, - byteLength: number, - offset?: number, - ): ArrayBuffer; - /** Copies the memory of the pointer into a typed array. Length is determined from the typed array's `byteLength`. Also takes optional byte offset from the pointer. */ - copyInto(destination: TypedArray, offset?: number): void; - /** Copies the memory of the specified pointer into a typed array. Length is determined from the typed array's `byteLength`. Also takes optional byte offset from the pointer. */ - static copyInto( - pointer: BigInt, - destination: TypedArray, - offset?: number, - ): void; - } - - /** - * **UNSTABLE**: Unsafe and new API, beware! - * - * An unsafe pointer to a function, for calling functions that are not - * present as symbols. - */ - export class UnsafeFnPointer { - pointer: bigint; - definition: Fn; - - constructor(pointer: bigint, definition: Fn); - - call: FromForeignFunction; - } - - export interface UnsafeCallbackDefinition< - Parameters extends readonly NativeType[] = readonly NativeType[], - Result extends NativeResultType = NativeResultType, - > { - parameters: Parameters; - result: Result; - } - - type UnsafeCallbackFunction< - Parameters extends readonly NativeType[] = readonly NativeType[], - Result extends NativeResultType = NativeResultType, - > = Parameters extends readonly [] ? () => ToNativeResultType : ( - ...args: FromNativeParameterTypes - ) => ToNativeResultType; - - /** - * **UNSTABLE**: Unsafe and new API, beware! - * - * An unsafe function pointer for passing JavaScript functions - * as C function pointers to ffi calls. - * - * The function pointer remains valid until the `close()` method is called. - * - * The callback can be explicitly ref'ed and deref'ed to stop Deno's - * process from exiting. - */ - export class UnsafeCallback< - Definition extends UnsafeCallbackDefinition = UnsafeCallbackDefinition, - > { - constructor( - definition: Definition, - callback: UnsafeCallbackFunction< - Definition["parameters"], - Definition["result"] - >, - ); - - pointer: bigint; - definition: Definition; - callback: UnsafeCallbackFunction< - Definition["parameters"], - Definition["result"] - >; - - /** - * Adds one to this callback's reference counting. - * - * If the callback's reference count becomes non-zero, it will keep - * Deno's process from exiting. - */ - ref(): void; - - /** - * Removes one from this callback's reference counting. - * - * If the callback's reference counter becomes zero, it will no longer - * keep Deno's process from exiting. - */ - unref(): void; - - /** - * Removes the C function pointer associated with the UnsafeCallback. - * Continuing to use the instance after calling this object will lead to errors - * and crashes. - * - * Calling this method will also immediately set the callback's reference - * counting to zero and it will no longer keep Deno's process from exiting. - */ - close(): void; - } - - /** A dynamic library resource */ - export interface DynamicLibrary { - /** All of the registered library along with functions for calling them */ - symbols: StaticForeignLibraryInterface; - close(): void; - } - - /** **UNSTABLE**: Unsafe and new API, beware! - * - * Opens a dynamic library and registers symbols - */ - export function dlopen( - filename: string | URL, - symbols: S, - ): DynamicLibrary; - - /** The log category for a diagnostic message. */ - export enum DiagnosticCategory { - Warning = 0, - Error = 1, - Suggestion = 2, - Message = 3, - } - - export interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain[]; - } - - export interface Diagnostic { - /** A string message summarizing the diagnostic. */ - messageText?: string; - /** An ordered array of further diagnostics. */ - messageChain?: DiagnosticMessageChain; - /** Information related to the diagnostic. This is present when there is a - * suggestion or other additional diagnostic information */ - relatedInformation?: Diagnostic[]; - /** The text of the source line related to the diagnostic. */ - sourceLine?: string; - source?: string; - /** The start position of the error. Zero based index. */ - start?: { - line: number; - character: number; - }; - /** The end position of the error. Zero based index. */ - end?: { - line: number; - character: number; - }; - /** The filename of the resource related to the diagnostic message. */ - fileName?: string; - /** The category of the diagnostic. */ - category: DiagnosticCategory; - /** A number identifier. */ - code: number; - } - - export type SetRawOptions = { - cbreak: boolean; - }; - - /** **UNSTABLE**: new API, yet to be vetted - * - * Set TTY to be under raw mode or not. In raw mode, characters are read and - * returned as is, without being processed. All special processing of - * characters by the terminal is disabled, including echoing input characters. - * Reading from a TTY device in raw mode is faster than reading from a TTY - * device in canonical mode. - * - * The `cbreak` option can be used to indicate that characters that correspond - * to a signal should still be generated. When disabling raw mode, this option - * is ignored. This functionality currently only works on Linux and Mac OS. - * - * ```ts - * Deno.setRaw(Deno.stdin.rid, true, { cbreak: true }); - * ``` - */ - export function setRaw( - rid: number, - mode: boolean, - options?: SetRawOptions, - ): void; - - /** **UNSTABLE**: needs investigation into high precision time. - * - * Synchronously changes the access (`atime`) and modification (`mtime`) times - * of a file system object referenced by `path`. Given times are either in - * seconds (UNIX epoch time) or as `Date` objects. - * - * ```ts - * Deno.utimeSync("myfile.txt", 1556495550, new Date()); - * ``` - * - * Requires `allow-write` permission. */ - export function utimeSync( - path: string | URL, - atime: number | Date, - mtime: number | Date, - ): void; - - /** **UNSTABLE**: needs investigation into high precision time. - * - * Changes the access (`atime`) and modification (`mtime`) times of a file - * system object referenced by `path`. Given times are either in seconds - * (UNIX epoch time) or as `Date` objects. - * - * ```ts - * await Deno.utime("myfile.txt", 1556495550, new Date()); - * ``` - * - * Requires `allow-write` permission. */ - export function utime( - path: string | URL, - atime: number | Date, - mtime: number | Date, - ): Promise; - - export function run< - T extends RunOptions & { - clearEnv?: boolean; - gid?: number; - uid?: number; - } = RunOptions & { - clearEnv?: boolean; - gid?: number; - uid?: number; - }, - >(opt: T): Process; - - /** **UNSTABLE**: New API, yet to be vetted. Additional consideration is still - * necessary around the permissions required. - * - * Get the `hostname` of the machine the Deno process is running on. - * - * ```ts - * console.log(Deno.hostname()); - * ``` - * - * Requires `allow-env` permission. - */ - export function hostname(): string; - - /** **UNSTABLE**: New API, yet to be vetted. - * A custom HttpClient for use with `fetch`. - * - * ```ts - * const caCert = await Deno.readTextFile("./ca.pem"); - * const client = Deno.createHttpClient({ caCerts: [ caCert ] }); - * const req = await fetch("https://myserver.com", { client }); - * ``` - */ - export class HttpClient { - rid: number; - close(): void; - } - - /** **UNSTABLE**: New API, yet to be vetted. - * The options used when creating a [HttpClient]. - */ - export interface CreateHttpClientOptions { - /** A list of root certificates that will be used in addition to the - * default root certificates to verify the peer's certificate. - * - * Must be in PEM format. */ - caCerts?: string[]; - /** A HTTP proxy to use for new connections. */ - proxy?: Proxy; - /** PEM formatted client certificate chain. */ - certChain?: string; - /** PEM formatted (RSA or PKCS8) private key of client certificate. */ - privateKey?: string; - } - - export interface Proxy { - url: string; - basicAuth?: BasicAuth; - } - - export interface BasicAuth { - username: string; - password: string; - } - - /** **UNSTABLE**: New API, yet to be vetted. - * Create a custom HttpClient for to use with `fetch`. - * - * ```ts - * const caCert = await Deno.readTextFile("./ca.pem"); - * const client = Deno.createHttpClient({ caCerts: [ caCert ] }); - * const response = await fetch("https://myserver.com", { client }); - * ``` - * - * ```ts - * const client = Deno.createHttpClient({ proxy: { url: "http://myproxy.com:8080" } }); - * const response = await fetch("https://myserver.com", { client }); - * ``` - */ - export function createHttpClient( - options: CreateHttpClientOptions, - ): HttpClient; - - /** **UNSTABLE**: needs investigation into high precision time. - * - * Synchronously changes the access (`atime`) and modification (`mtime`) times - * of a file stream resource referenced by `rid`. Given times are either in - * seconds (UNIX epoch time) or as `Date` objects. - * - * ```ts - * const file = Deno.openSync("file.txt", { create: true, write: true }); - * Deno.futimeSync(file.rid, 1556495550, new Date()); - * ``` - */ - export function futimeSync( - rid: number, - atime: number | Date, - mtime: number | Date, - ): void; - - /** **UNSTABLE**: needs investigation into high precision time. - * - * Changes the access (`atime`) and modification (`mtime`) times of a file - * stream resource referenced by `rid`. Given times are either in seconds - * (UNIX epoch time) or as `Date` objects. - * - * ```ts - * const file = await Deno.open("file.txt", { create: true, write: true }); - * await Deno.futime(file.rid, 1556495550, new Date()); - * ``` - */ - export function futime( - rid: number, - atime: number | Date, - mtime: number | Date, - ): Promise; - - /** **UNSTABLE**: new API, yet to be vetted. - * - * A generic transport listener for message-oriented protocols. */ - export interface DatagramConn extends AsyncIterable<[Uint8Array, Addr]> { - /** **UNSTABLE**: new API, yet to be vetted. - * - * Waits for and resolves to the next message to the `UDPConn`. */ - receive(p?: Uint8Array): Promise<[Uint8Array, Addr]>; - /** UNSTABLE: new API, yet to be vetted. - * - * Sends a message to the target. */ - send(p: Uint8Array, addr: Addr): Promise; - /** UNSTABLE: new API, yet to be vetted. - * - * Close closes the socket. Any pending message promises will be rejected - * with errors. */ - close(): void; - /** Return the address of the `UDPConn`. */ - readonly addr: Addr; - [Symbol.asyncIterator](): AsyncIterableIterator<[Uint8Array, Addr]>; - } - - export interface UnixListenOptions { - /** A Path to the Unix Socket. */ - path: string; - } - - /** **UNSTABLE**: new API, yet to be vetted. - * - * Listen announces on the local transport address. - * - * ```ts - * const listener = Deno.listen({ path: "/foo/bar.sock", transport: "unix" }) - * ``` - * - * Requires `allow-read` and `allow-write` permission. */ - export function listen( - options: UnixListenOptions & { transport: "unix" }, - ): Listener; - - /** **UNSTABLE**: new API, yet to be vetted - * - * Listen announces on the local transport address. - * - * ```ts - * const listener1 = Deno.listenDatagram({ - * port: 80, - * transport: "udp" - * }); - * const listener2 = Deno.listenDatagram({ - * hostname: "golang.org", - * port: 80, - * transport: "udp" - * }); - * ``` - * - * Requires `allow-net` permission. */ - export function listenDatagram( - options: ListenOptions & { transport: "udp" }, - ): DatagramConn; - - /** **UNSTABLE**: new API, yet to be vetted - * - * Listen announces on the local transport address. - * - * ```ts - * const listener = Deno.listenDatagram({ - * path: "/foo/bar.sock", - * transport: "unixpacket" - * }); - * ``` - * - * Requires `allow-read` and `allow-write` permission. */ - export function listenDatagram( - options: UnixListenOptions & { transport: "unixpacket" }, - ): DatagramConn; - - export interface UnixConnectOptions { - transport: "unix"; - path: string; - } - - /** **UNSTABLE**: The unix socket transport is unstable as a new API yet to - * be vetted. The TCP transport is considered stable. - * - * Connects to the hostname (default is "127.0.0.1") and port on the named - * transport (default is "tcp"), and resolves to the connection (`Conn`). - * - * ```ts - * const conn1 = await Deno.connect({ port: 80 }); - * const conn2 = await Deno.connect({ hostname: "192.0.2.1", port: 80 }); - * const conn3 = await Deno.connect({ hostname: "[2001:db8::1]", port: 80 }); - * const conn4 = await Deno.connect({ hostname: "golang.org", port: 80, transport: "tcp" }); - * const conn5 = await Deno.connect({ path: "/foo/bar.sock", transport: "unix" }); - * ``` - * - * Requires `allow-net` permission for "tcp" and `allow-read` for "unix". */ - export function connect( - options: ConnectOptions, - ): Promise; - export function connect( - options: UnixConnectOptions, - ): Promise; - - export interface ConnectTlsOptions { - /** PEM formatted client certificate chain. */ - certChain?: string; - /** PEM formatted (RSA or PKCS8) private key of client certificate. */ - privateKey?: string; - /** **UNSTABLE**: new API, yet to be vetted. - * - * Application-Layer Protocol Negotiation (ALPN) protocols supported by - * the client. If not specified, no ALPN extension will be included in the - * TLS handshake. - */ - alpnProtocols?: string[]; - } - - export interface TlsHandshakeInfo { - /** **UNSTABLE**: new API, yet to be vetted. - * - * Contains the ALPN protocol selected during negotiation with the server. - * If no ALPN protocol selected, returns `null`. - */ - alpnProtocol: string | null; - } - - export interface TlsConn extends Conn { - /** Runs the client or server handshake protocol to completion if that has - * not happened yet. Calling this method is optional; the TLS handshake - * will be completed automatically as soon as data is sent or received. */ - handshake(): Promise; - } - - /** **UNSTABLE** New API, yet to be vetted. - * - * Create a TLS connection with an attached client certificate. - * - * ```ts - * const conn = await Deno.connectTls({ - * hostname: "deno.land", - * port: 443, - * certChain: "---- BEGIN CERTIFICATE ----\n ...", - * privateKey: "---- BEGIN PRIVATE KEY ----\n ...", - * }); - * ``` - * - * Requires `allow-net` permission. - */ - export function connectTls(options: ConnectTlsOptions): Promise; - - export interface ListenTlsOptions { - /** **UNSTABLE**: new API, yet to be vetted. - * - * Application-Layer Protocol Negotiation (ALPN) protocols to announce to - * the client. If not specified, no ALPN extension will be included in the - * TLS handshake. - */ - alpnProtocols?: string[]; - } - - export interface StartTlsOptions { - /** **UNSTABLE**: new API, yet to be vetted. - * - * Application-Layer Protocol Negotiation (ALPN) protocols to announce to - * the client. If not specified, no ALPN extension will be included in the - * TLS handshake. - */ - alpnProtocols?: string[]; - } - - export interface Listener extends AsyncIterable { - /** **UNSTABLE**: new API, yet to be vetted. - * - * Make the listener block the event loop from finishing. - * - * Note: the listener blocks the event loop from finishing by default. - * This method is only meaningful after `.unref()` is called. - */ - ref(): void; - /** **UNSTABLE**: new API, yet to be vetted. - * - * Make the listener not block the event loop from finishing. - */ - unref(): void; - } - - /** **UNSTABLE**: New API should be tested first. - * - * Acquire an advisory file-system lock for the provided file. `exclusive` - * defaults to `false`. - */ - export function flock(rid: number, exclusive?: boolean): Promise; - - /** **UNSTABLE**: New API should be tested first. - * - * Acquire an advisory file-system lock for the provided file. `exclusive` - * defaults to `false`. - */ - export function flockSync(rid: number, exclusive?: boolean): void; - - /** **UNSTABLE**: New API should be tested first. - * - * Release an advisory file-system lock for the provided file. - */ - export function funlock(rid: number): Promise; - - /** **UNSTABLE**: New API should be tested first. - * - * Release an advisory file-system lock for the provided file. - */ - export function funlockSync(rid: number): void; - - /** **UNSTABLE**: new API, yet to be vetted. - * - * Make the timer of the given id blocking the event loop from finishing - */ - export function refTimer(id: number): void; - - /** **UNSTABLE**: new API, yet to be vetted. - * - * Make the timer of the given id not blocking the event loop from finishing - */ - export function unrefTimer(id: number): void; - - /** **UNSTABLE**: new API, yet to be vetter. - * - * Allows to "hijack" a connection that the request is associated with. - * Can be used to implement protocols that build on top of HTTP (eg. - * WebSockets). - * - * The returned promise returns underlying connection and first packet - * received. The promise shouldn't be awaited before responding to the - * `request`, otherwise event loop might deadlock. - */ - export function upgradeHttp( - request: Request, - ): Promise<[Deno.Conn, Uint8Array]>; - - export interface SpawnOptions { - /** Arguments to pass to the process. */ - args?: string[]; - /** - * The working directory of the process. - * If not specified, the cwd of the parent process is used. - */ - cwd?: string | URL; - /** - * Clear environmental variables from parent process. - * Doesn't guarantee that only `opt.env` variables are present, - * as the OS may set environmental variables for processes. - */ - clearEnv?: boolean; - /** Environmental variables to pass to the subprocess. */ - env?: Record; - /** - * Sets the child process’s user ID. This translates to a setuid call - * in the child process. Failure in the setuid call will cause the spawn to fail. - */ - uid?: number; - /** Similar to `uid`, but sets the group ID of the child process. */ - gid?: number; - /** - * An AbortSignal that allows closing the process using the corresponding - * AbortController by sending the process a SIGTERM signal. - * Not Supported by execSync. - */ - signal?: AbortSignal; - - /** Defaults to "null". */ - stdin?: "piped" | "inherit" | "null"; - /** Defaults to "piped". */ - stdout?: "piped" | "inherit" | "null"; - /** Defaults to "piped". */ - stderr?: "piped" | "inherit" | "null"; - } - - /** - * Spawns a child process. - * - * If any stdio options are not set to `"piped"`, accessing the corresponding - * field on the `Child` or its `SpawnOutput` will throw a `TypeError`. - * - * If stdin is set to `"piped"`, the stdin WritableStream needs to be closed - * manually. - * - * ```ts - * const child = Deno.spawnChild(Deno.execPath(), { - * args: [ - * "eval", - * "console.log('Hello World')", - * ], - * stdin: "piped", - * }); - * - * // open a file and pipe the subprocess output to it. - * child.stdout.pipeTo(Deno.openSync("output").writable); - * - * // manually close stdin - * child.stdin.close(); - * const status = await child.status; - * ``` - */ - export function spawnChild( - command: string | URL, - options?: SpawnOptions, - ): Child; - - export class Child { - get stdin(): WritableStream; - get stdout(): ReadableStream; - get stderr(): ReadableStream; - readonly pid: number; - /** Get the status of the child. */ - readonly status: Promise; - - /** Waits for the child to exit completely, returning all its output and status. */ - output(): Promise; - /** Kills the process with given Signal. Defaults to SIGTERM. */ - kill(signo?: Signal): void; - - ref(): void; - unref(): void; - } - - /** - * Executes a subprocess, waiting for it to finish and - * collecting all of its output. - * Will throw an error if `stdin: "piped"` is passed. - * - * If options `stdout` or `stderr` are not set to `"piped"`, accessing the - * corresponding field on `SpawnOutput` will throw a `TypeError`. - * - * ```ts - * const { code, stdout, stderr } = await Deno.spawn(Deno.execPath(), { - * args: [ - * "eval", - * "console.log('hello'); console.error('world')", - * ], - * }); - * console.assert(code === 0); - * console.assert("hello\n" === new TextDecoder().decode(stdout)); - * console.assert("world\n" === new TextDecoder().decode(stderr)); - * ``` - */ - export function spawn( - command: string | URL, - options?: SpawnOptions, - ): Promise; - - /** - * Synchronously executes a subprocess, waiting for it to finish and - * collecting all of its output. - * Will throw an error if `stdin: "piped"` is passed. - * - * If options `stdout` or `stderr` are not set to `"piped"`, accessing the - * corresponding field on `SpawnOutput` will throw a `TypeError`. - * - * ```ts - * const { code, stdout, stderr } = Deno.spawnSync(Deno.execPath(), { - * args: [ - * "eval", - * "console.log('hello'); console.error('world')", - * ], - * }); - * console.assert(code === 0); - * console.assert("hello\n" === new TextDecoder().decode(stdout)); - * console.assert("world\n" === new TextDecoder().decode(stderr)); - * ``` - */ - export function spawnSync( - command: string | URL, - options?: SpawnOptions, - ): SpawnOutput; - - export interface ChildStatus { - success: boolean; - code: number; - signal: Signal | null; - } - - export interface SpawnOutput extends ChildStatus { - get stdout(): Uint8Array; - get stderr(): Uint8Array; - } -} - -declare function fetch( - input: Request | URL | string, - init?: RequestInit & { client: Deno.HttpClient }, -): Promise; - -declare interface WorkerOptions { - /** UNSTABLE: New API. - * - * Configure permissions options to change the level of access the worker will - * have. By default it will have no permissions. Note that the permissions - * of a worker can't be extended beyond its parent's permissions reach. - * - "inherit" will take the permissions of the thread the worker is created in - * - "none" will use the default behavior and have no permission - * - You can provide a list of routes relative to the file the worker - * is created in to limit the access of the worker (read/write permissions only) - * - * Example: - * - * ```ts - * // mod.ts - * const worker = new Worker( - * new URL("deno_worker.ts", import.meta.url).href, { - * type: "module", - * deno: { - * permissions: { - * read: true, - * }, - * }, - * } - * ); - * ``` - */ - deno?: { - /** Set to `"none"` to disable all the permissions in the worker. */ - permissions?: Deno.PermissionOptions; - }; -} - -declare interface WebSocketStreamOptions { - protocols?: string[]; - signal?: AbortSignal; - headers?: HeadersInit; -} - -declare interface WebSocketConnection { - readable: ReadableStream; - writable: WritableStream; - extensions: string; - protocol: string; -} - -declare interface WebSocketCloseInfo { - code?: number; - reason?: string; -} - -declare class WebSocketStream { - constructor(url: string, options?: WebSocketStreamOptions); - url: string; - connection: Promise; - closed: Promise; - close(closeInfo?: WebSocketCloseInfo): void; -} diff --git a/components/clarinet-cli/dts/lib.deno.window.d.ts b/components/clarinet-cli/dts/lib.deno.window.d.ts deleted file mode 100644 index 1dbfb0493..000000000 --- a/components/clarinet-cli/dts/lib.deno.window.d.ts +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -/// -/// -/// -/// -/// -/// - -interface WindowEventMap { - "error": ErrorEvent; - "unhandledrejection": PromiseRejectionEvent; -} - -declare class Window extends EventTarget { - new(): Window; - readonly window: Window & typeof globalThis; - readonly self: Window & typeof globalThis; - onerror: ((this: Window, ev: ErrorEvent) => any) | null; - onload: ((this: Window, ev: Event) => any) | null; - onunload: ((this: Window, ev: Event) => any) | null; - onunhandledrejection: - | ((this: Window, ev: PromiseRejectionEvent) => any) - | null; - close: () => void; - readonly closed: boolean; - alert: (message?: string) => void; - confirm: (message?: string) => boolean; - prompt: (message?: string, defaultValue?: string) => string | null; - Deno: typeof Deno; - Navigator: typeof Navigator; - navigator: Navigator; - Location: typeof Location; - location: Location; - localStorage: Storage; - sessionStorage: Storage; - - addEventListener( - type: K, - listener: ( - this: Window, - ev: WindowEventMap[K], - ) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: ( - this: Window, - ev: WindowEventMap[K], - ) => any, - options?: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; -} - -declare var window: Window & typeof globalThis; -declare var self: Window & typeof globalThis; -declare var onerror: ((this: Window, ev: ErrorEvent) => any) | null; -declare var onload: ((this: Window, ev: Event) => any) | null; -declare var onunload: ((this: Window, ev: Event) => any) | null; -declare var onunhandledrejection: - | ((this: Window, ev: PromiseRejectionEvent) => any) - | null; -declare var localStorage: Storage; -declare var sessionStorage: Storage; - -declare class Navigator { - constructor(); - readonly gpu: GPU; - readonly hardwareConcurrency: number; - readonly userAgent: string; -} - -declare var navigator: Navigator; - -/** - * Shows the given message and waits for the enter key pressed. - * If the stdin is not interactive, it does nothing. - * @param message - */ -declare function alert(message?: string): void; - -/** - * Shows the given message and waits for the answer. Returns the user's answer as boolean. - * Only `y` and `Y` are considered as true. - * If the stdin is not interactive, it returns false. - * @param message - */ -declare function confirm(message?: string): boolean; - -/** - * Shows the given message and waits for the user's input. Returns the user's input as string. - * If the default value is given and the user inputs the empty string, then it returns the given - * default value. - * If the default value is not given and the user inputs the empty string, it returns null. - * If the stdin is not interactive, it returns null. - * @param message - * @param defaultValue - */ -declare function prompt(message?: string, defaultValue?: string): string | null; - -/** Registers an event listener in the global scope, which will be called - * synchronously whenever the event `type` is dispatched. - * - * ```ts - * addEventListener('unload', () => { console.log('All finished!'); }); - * ... - * dispatchEvent(new Event('unload')); - * ``` - */ -declare function addEventListener< - K extends keyof WindowEventMap, ->( - type: K, - listener: (this: Window, ev: WindowEventMap[K]) => any, - options?: boolean | AddEventListenerOptions, -): void; -declare function addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, -): void; - -/** Remove a previously registered event listener from the global scope - * - * ```ts - * const listener = () => { console.log('hello'); }; - * addEventListener('load', listener); - * removeEventListener('load', listener); - * ``` - */ -declare function removeEventListener< - K extends keyof WindowEventMap, ->( - type: K, - listener: (this: Window, ev: WindowEventMap[K]) => any, - options?: boolean | EventListenerOptions, -): void; -declare function removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, -): void; - -// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is. -// The types there must first be split into window, worker and global types. -/** The location (URL) of the object it is linked to. Changes done on it are - * reflected on the object it relates to. Accessible via - * `globalThis.location`. */ -declare class Location { - constructor(); - /** Returns a DOMStringList object listing the origins of the ancestor - * browsing contexts, from the parent browsing context to the top-level - * browsing context. - * - * Always empty in Deno. */ - readonly ancestorOrigins: DOMStringList; - /** Returns the Location object's URL's fragment (includes leading "#" if - * non-empty). - * - * Cannot be set in Deno. */ - hash: string; - /** Returns the Location object's URL's host and port (if different from the - * default port for the scheme). - * - * Cannot be set in Deno. */ - host: string; - /** Returns the Location object's URL's host. - * - * Cannot be set in Deno. */ - hostname: string; - /** Returns the Location object's URL. - * - * Cannot be set in Deno. */ - href: string; - toString(): string; - /** Returns the Location object's URL's origin. */ - readonly origin: string; - /** Returns the Location object's URL's path. - * - * Cannot be set in Deno. */ - pathname: string; - /** Returns the Location object's URL's port. - * - * Cannot be set in Deno. */ - port: string; - /** Returns the Location object's URL's scheme. - * - * Cannot be set in Deno. */ - protocol: string; - /** Returns the Location object's URL's query (includes leading "?" if - * non-empty). - * - * Cannot be set in Deno. */ - search: string; - /** Navigates to the given URL. - * - * Cannot be set in Deno. */ - assign(url: string): void; - /** Reloads the current page. - * - * Disabled in Deno. */ - reload(): void; - /** @deprecated */ - reload(forcedReload: boolean): void; - /** Removes the current page from the session history and navigates to the - * given URL. - * - * Disabled in Deno. */ - replace(url: string): void; -} - -// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is. -// The types there must first be split into window, worker and global types. -declare var location: Location; diff --git a/components/clarinet-cli/dts/lib.deno.worker.d.ts b/components/clarinet-cli/dts/lib.deno.worker.d.ts deleted file mode 100644 index 7be9211a4..000000000 --- a/components/clarinet-cli/dts/lib.deno.worker.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -/// -/// -/// -/// -/// - -interface WorkerGlobalScopeEventMap { - "error": ErrorEvent; - "unhandledrejection": PromiseRejectionEvent; -} - -declare class WorkerGlobalScope extends EventTarget { - readonly location: WorkerLocation; - readonly navigator: WorkerNavigator; - onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null; - onunhandledrejection: - | ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) - | null; - - readonly self: WorkerGlobalScope & typeof globalThis; - - addEventListener( - type: K, - listener: ( - this: WorkerGlobalScope, - ev: WorkerGlobalScopeEventMap[K], - ) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: ( - this: WorkerGlobalScope, - ev: WorkerGlobalScopeEventMap[K], - ) => any, - options?: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; - - Deno: typeof Deno; -} - -declare class WorkerNavigator { - constructor(); - readonly gpu: GPU; - readonly hardwareConcurrency: number; - readonly userAgent: string; -} - -declare var navigator: WorkerNavigator; - -interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { - "message": MessageEvent; - "messageerror": MessageEvent; -} - -declare class DedicatedWorkerGlobalScope extends WorkerGlobalScope { - readonly name: string; - onmessage: - | ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) - | null; - onmessageerror: - | ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) - | null; - close(): void; - postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: StructuredSerializeOptions): void; - addEventListener( - type: K, - listener: ( - this: DedicatedWorkerGlobalScope, - ev: DedicatedWorkerGlobalScopeEventMap[K], - ) => any, - options?: boolean | AddEventListenerOptions, - ): void; - addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, - ): void; - removeEventListener( - type: K, - listener: ( - this: DedicatedWorkerGlobalScope, - ev: DedicatedWorkerGlobalScopeEventMap[K], - ) => any, - options?: boolean | EventListenerOptions, - ): void; - removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, - ): void; -} - -declare var name: string; -declare var onmessage: - | ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) - | null; -declare var onmessageerror: - | ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) - | null; -declare function close(): void; -declare function postMessage(message: any, transfer: Transferable[]): void; -declare function postMessage( - message: any, - options?: StructuredSerializeOptions, -): void; -declare var navigator: WorkerNavigator; -declare var onerror: - | ((this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any) - | null; -declare var onunhandledrejection: - | ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) - | null; -declare var self: WorkerGlobalScope & typeof globalThis; -declare function addEventListener< - K extends keyof DedicatedWorkerGlobalScopeEventMap, ->( - type: K, - listener: ( - this: DedicatedWorkerGlobalScope, - ev: DedicatedWorkerGlobalScopeEventMap[K], - ) => any, - options?: boolean | AddEventListenerOptions, -): void; -declare function addEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | AddEventListenerOptions, -): void; -declare function removeEventListener< - K extends keyof DedicatedWorkerGlobalScopeEventMap, ->( - type: K, - listener: ( - this: DedicatedWorkerGlobalScope, - ev: DedicatedWorkerGlobalScopeEventMap[K], - ) => any, - options?: boolean | EventListenerOptions, -): void; -declare function removeEventListener( - type: string, - listener: EventListenerOrEventListenerObject, - options?: boolean | EventListenerOptions, -): void; - -// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is. -// The types there must first be split into window, worker and global types. -/** The absolute location of the script executed by the Worker. Such an object - * is initialized for each worker and is available via the - * WorkerGlobalScope.location property obtained by calling self.location. */ -declare class WorkerLocation { - constructor(); - readonly hash: string; - readonly host: string; - readonly hostname: string; - readonly href: string; - toString(): string; - readonly origin: string; - readonly pathname: string; - readonly port: string; - readonly protocol: string; - readonly search: string; -} - -// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is. -// The types there must first be split into window, worker and global types. -declare var location: WorkerLocation; diff --git a/components/clarinet-cli/dts/lib.deno_webgpu.d.ts b/components/clarinet-cli/dts/lib.deno_webgpu.d.ts deleted file mode 100644 index 8d1c9919f..000000000 --- a/components/clarinet-cli/dts/lib.deno_webgpu.d.ts +++ /dev/null @@ -1,1186 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -// deno-lint-ignore-file no-explicit-any no-empty-interface - -/// -/// - -interface GPUObjectBase { - label: string; -} - -declare interface GPUObjectDescriptorBase { - label?: string; -} - -declare class GPUSupportedLimits { - maxTextureDimension1D?: number; - maxTextureDimension2D?: number; - maxTextureDimension3D?: number; - maxTextureArrayLayers?: number; - maxBindGroups?: number; - maxDynamicUniformBuffersPerPipelineLayout?: number; - maxDynamicStorageBuffersPerPipelineLayout?: number; - maxSampledTexturesPerShaderStage?: number; - maxSamplersPerShaderStage?: number; - maxStorageBuffersPerShaderStage?: number; - maxStorageTexturesPerShaderStage?: number; - maxUniformBuffersPerShaderStage?: number; - maxUniformBufferBindingSize?: number; - maxStorageBufferBindingSize?: number; - minUniformBufferOffsetAlignment?: number; - minStorageBufferOffsetAlignment?: number; - maxVertexBuffers?: number; - maxVertexAttributes?: number; - maxVertexBufferArrayStride?: number; - maxInterStageShaderComponents?: number; - maxComputeWorkgroupStorageSize?: number; - maxComputeInvocationsPerWorkgroup?: number; - maxComputeWorkgroupSizeX?: number; - maxComputeWorkgroupSizeY?: number; - maxComputeWorkgroupSizeZ?: number; - maxComputeWorkgroupsPerDimension?: number; -} - -declare class GPUSupportedFeatures { - forEach( - callbackfn: ( - value: GPUFeatureName, - value2: GPUFeatureName, - set: Set, - ) => void, - thisArg?: any, - ): void; - has(value: GPUFeatureName): boolean; - size: number; - [ - Symbol - .iterator - ](): IterableIterator; - entries(): IterableIterator<[GPUFeatureName, GPUFeatureName]>; - keys(): IterableIterator; - values(): IterableIterator; -} - -declare class GPUAdapterInfo { - readonly vendor: string; - readonly architecture: string; - readonly device: string; - readonly description: string; -} - -declare class GPU { - requestAdapter( - options?: GPURequestAdapterOptions, - ): Promise; -} - -declare interface GPURequestAdapterOptions { - powerPreference?: GPUPowerPreference; - forceFallbackAdapter?: boolean; -} - -declare type GPUPowerPreference = "low-power" | "high-performance"; - -declare class GPUAdapter { - readonly features: GPUSupportedFeatures; - readonly limits: GPUSupportedLimits; - readonly isFallbackAdapter: boolean; - - requestDevice(descriptor?: GPUDeviceDescriptor): Promise; - requestAdapterInfo(unmaskHints?: string[]): Promise; -} - -declare interface GPUDeviceDescriptor extends GPUObjectDescriptorBase { - requiredFeatures?: GPUFeatureName[]; - requiredLimits?: Record; -} - -declare type GPUFeatureName = - | "depth-clip-control" - | "depth24unorm-stencil8" - | "depth32float-stencil8" - | "pipeline-statistics-query" - | "texture-compression-bc" - | "texture-compression-etc2" - | "texture-compression-astc" - | "timestamp-query" - | "indirect-first-instance" - | "shader-f16" - // extended from spec - | "mappable-primary-buffers" - | "sampled-texture-binding-array" - | "sampled-texture-array-dynamic-indexing" - | "sampled-texture-array-non-uniform-indexing" - | "unsized-binding-array" - | "multi-draw-indirect" - | "multi-draw-indirect-count" - | "push-constants" - | "address-mode-clamp-to-border" - | "texture-adapter-specific-format-features" - | "shader-float64" - | "vertex-attribute-64bit"; - -declare class GPUDevice extends EventTarget implements GPUObjectBase { - label: string; - - readonly lost: Promise; - pushErrorScope(filter: GPUErrorFilter): undefined; - popErrorScope(): Promise; - onuncapturederror: - | ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any) - | null; - - readonly features: ReadonlyArray; - readonly limits: Record; - readonly queue: GPUQueue; - - destroy(): undefined; - - createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer; - createTexture(descriptor: GPUTextureDescriptor): GPUTexture; - createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler; - - createBindGroupLayout( - descriptor: GPUBindGroupLayoutDescriptor, - ): GPUBindGroupLayout; - createPipelineLayout( - descriptor: GPUPipelineLayoutDescriptor, - ): GPUPipelineLayout; - createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup; - - createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule; - createComputePipeline( - descriptor: GPUComputePipelineDescriptor, - ): GPUComputePipeline; - createRenderPipeline( - descriptor: GPURenderPipelineDescriptor, - ): GPURenderPipeline; - createComputePipelineAsync( - descriptor: GPUComputePipelineDescriptor, - ): Promise; - createRenderPipelineAsync( - descriptor: GPURenderPipelineDescriptor, - ): Promise; - - createCommandEncoder( - descriptor?: GPUCommandEncoderDescriptor, - ): GPUCommandEncoder; - createRenderBundleEncoder( - descriptor: GPURenderBundleEncoderDescriptor, - ): GPURenderBundleEncoder; - - createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet; -} - -declare class GPUBuffer implements GPUObjectBase { - label: string; - - mapAsync( - mode: GPUMapModeFlags, - offset?: number, - size?: number, - ): Promise; - getMappedRange(offset?: number, size?: number): ArrayBuffer; - unmap(): undefined; - - destroy(): undefined; -} - -declare interface GPUBufferDescriptor extends GPUObjectDescriptorBase { - size: number; - usage: GPUBufferUsageFlags; - mappedAtCreation?: boolean; -} - -declare type GPUBufferUsageFlags = number; -declare class GPUBufferUsage { - static MAP_READ: 0x0001; - static MAP_WRITE: 0x0002; - static COPY_SRC: 0x0004; - static COPY_DST: 0x0008; - static INDEX: 0x0010; - static VERTEX: 0x0020; - static UNIFORM: 0x0040; - static STORAGE: 0x0080; - static INDIRECT: 0x0100; - static QUERY_RESOLVE: 0x0200; -} - -declare type GPUMapModeFlags = number; -declare class GPUMapMode { - static READ: 0x0001; - static WRITE: 0x0002; -} - -declare class GPUTexture implements GPUObjectBase { - label: string; - - createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView; - destroy(): undefined; -} - -declare interface GPUTextureDescriptor extends GPUObjectDescriptorBase { - size: GPUExtent3D; - mipLevelCount?: number; - sampleCount?: number; - dimension?: GPUTextureDimension; - format: GPUTextureFormat; - usage: GPUTextureUsageFlags; -} - -declare type GPUTextureDimension = "1d" | "2d" | "3d"; - -declare type GPUTextureUsageFlags = number; -declare class GPUTextureUsage { - static COPY_SRC: 0x01; - static COPY_DST: 0x02; - static TEXTURE_BINDING: 0x04; - static STORAGE_BINDING: 0x08; - static RENDER_ATTACHMENT: 0x10; -} - -declare class GPUTextureView implements GPUObjectBase { - label: string; -} - -declare interface GPUTextureViewDescriptor extends GPUObjectDescriptorBase { - format?: GPUTextureFormat; - dimension?: GPUTextureViewDimension; - aspect?: GPUTextureAspect; - baseMipLevel?: number; - mipLevelCount?: number; - baseArrayLayer?: number; - arrayLayerCount?: number; -} - -declare type GPUTextureViewDimension = - | "1d" - | "2d" - | "2d-array" - | "cube" - | "cube-array" - | "3d"; - -declare type GPUTextureAspect = "all" | "stencil-only" | "depth-only"; - -declare type GPUTextureFormat = - | "r8unorm" - | "r8snorm" - | "r8uint" - | "r8sint" - | "r16uint" - | "r16sint" - | "r16float" - | "rg8unorm" - | "rg8snorm" - | "rg8uint" - | "rg8sint" - | "r32uint" - | "r32sint" - | "r32float" - | "rg16uint" - | "rg16sint" - | "rg16float" - | "rgba8unorm" - | "rgba8unorm-srgb" - | "rgba8snorm" - | "rgba8uint" - | "rgba8sint" - | "bgra8unorm" - | "bgra8unorm-srgb" - | "rgb9e5ufloat" - | "rgb10a2unorm" - | "rg11b10ufloat" - | "rg32uint" - | "rg32sint" - | "rg32float" - | "rgba16uint" - | "rgba16sint" - | "rgba16float" - | "rgba32uint" - | "rgba32sint" - | "rgba32float" - | "stencil8" - | "depth16unorm" - | "depth24plus" - | "depth24plus-stencil8" - | "depth32float" - | "depth24unorm-stencil8" - | "depth32float-stencil8" - | "bc1-rgba-unorm" - | "bc1-rgba-unorm-srgb" - | "bc2-rgba-unorm" - | "bc2-rgba-unorm-srgb" - | "bc3-rgba-unorm" - | "bc3-rgba-unorm-srgb" - | "bc4-r-unorm" - | "bc4-r-snorm" - | "bc5-rg-unorm" - | "bc5-rg-snorm" - | "bc6h-rgb-ufloat" - | "bc6h-rgb-float" - | "bc7-rgba-unorm" - | "bc7-rgba-unorm-srgb" - | "etc2-rgb8unorm" - | "etc2-rgb8unorm-srgb" - | "etc2-rgb8a1unorm" - | "etc2-rgb8a1unorm-srgb" - | "etc2-rgba8unorm" - | "etc2-rgba8unorm-srgb" - | "eac-r11unorm" - | "eac-r11snorm" - | "eac-rg11unorm" - | "eac-rg11snorm" - | "astc-4x4-unorm" - | "astc-4x4-unorm-srgb" - | "astc-5x4-unorm" - | "astc-5x4-unorm-srgb" - | "astc-5x5-unorm" - | "astc-5x5-unorm-srgb" - | "astc-6x5-unorm" - | "astc-6x5-unorm-srgb" - | "astc-6x6-unorm" - | "astc-6x6-unorm-srgb" - | "astc-8x5-unorm" - | "astc-8x5-unorm-srgb" - | "astc-8x6-unorm" - | "astc-8x6-unorm-srgb" - | "astc-8x8-unorm" - | "astc-8x8-unorm-srgb" - | "astc-10x5-unorm" - | "astc-10x5-unorm-srgb" - | "astc-10x6-unorm" - | "astc-10x6-unorm-srgb" - | "astc-10x8-unorm" - | "astc-10x8-unorm-srgb" - | "astc-10x10-unorm" - | "astc-10x10-unorm-srgb" - | "astc-12x10-unorm" - | "astc-12x10-unorm-srgb" - | "astc-12x12-unorm" - | "astc-12x12-unorm-srgb"; - -declare class GPUSampler implements GPUObjectBase { - label: string; -} - -declare interface GPUSamplerDescriptor extends GPUObjectDescriptorBase { - addressModeU?: GPUAddressMode; - addressModeV?: GPUAddressMode; - addressModeW?: GPUAddressMode; - magFilter?: GPUFilterMode; - minFilter?: GPUFilterMode; - mipmapFilter?: GPUMipmapFilterMode; - lodMinClamp?: number; - lodMaxClamp?: number; - compare?: GPUCompareFunction; - maxAnisotropy?: number; -} - -declare type GPUAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat"; - -declare type GPUFilterMode = "nearest" | "linear"; - -declare type GPUMipmapFilterMode = "nearest" | "linear"; - -declare type GPUCompareFunction = - | "never" - | "less" - | "equal" - | "less-equal" - | "greater" - | "not-equal" - | "greater-equal" - | "always"; - -declare class GPUBindGroupLayout implements GPUObjectBase { - label: string; -} - -declare interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase { - entries: GPUBindGroupLayoutEntry[]; -} - -declare interface GPUBindGroupLayoutEntry { - binding: number; - visibility: GPUShaderStageFlags; - - buffer?: GPUBufferBindingLayout; - sampler?: GPUSamplerBindingLayout; - texture?: GPUTextureBindingLayout; - storageTexture?: GPUStorageTextureBindingLayout; -} - -declare type GPUShaderStageFlags = number; -declare class GPUShaderStage { - static VERTEX: 0x1; - static FRAGMENT: 0x2; - static COMPUTE: 0x4; -} - -declare interface GPUBufferBindingLayout { - type?: GPUBufferBindingType; - hasDynamicOffset?: boolean; - minBindingSize?: number; -} - -declare type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage"; - -declare interface GPUSamplerBindingLayout { - type?: GPUSamplerBindingType; -} - -declare type GPUSamplerBindingType = - | "filtering" - | "non-filtering" - | "comparison"; - -declare interface GPUTextureBindingLayout { - sampleType?: GPUTextureSampleType; - viewDimension?: GPUTextureViewDimension; - multisampled?: boolean; -} - -declare type GPUTextureSampleType = - | "float" - | "unfilterable-float" - | "depth" - | "sint" - | "uint"; - -declare type GPUStorageTextureAccess = "write-only"; - -declare interface GPUStorageTextureBindingLayout { - access: GPUStorageTextureAccess; - format: GPUTextureFormat; - viewDimension?: GPUTextureViewDimension; -} - -declare class GPUBindGroup implements GPUObjectBase { - label: string; -} - -declare interface GPUBindGroupDescriptor extends GPUObjectDescriptorBase { - layout: GPUBindGroupLayout; - entries: GPUBindGroupEntry[]; -} - -declare type GPUBindingResource = - | GPUSampler - | GPUTextureView - | GPUBufferBinding; - -declare interface GPUBindGroupEntry { - binding: number; - resource: GPUBindingResource; -} - -declare interface GPUBufferBinding { - buffer: GPUBuffer; - offset?: number; - size?: number; -} - -declare class GPUPipelineLayout implements GPUObjectBase { - label: string; -} - -declare interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { - bindGroupLayouts: GPUBindGroupLayout[]; -} - -declare type GPUCompilationMessageType = "error" | "warning" | "info"; - -declare interface GPUCompilationMessage { - readonly message: string; - readonly type: GPUCompilationMessageType; - readonly lineNum: number; - readonly linePos: number; -} - -declare interface GPUCompilationInfo { - readonly messages: ReadonlyArray; -} - -declare class GPUShaderModule implements GPUObjectBase { - label: string; - - compilationInfo(): Promise; -} - -declare interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase { - code: string; - sourceMap?: any; -} - -declare type GPUAutoLayoutMode = "auto"; - -declare interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase { - layout: GPUPipelineLayout | GPUAutoLayoutMode; -} - -declare interface GPUPipelineBase { - getBindGroupLayout(index: number): GPUBindGroupLayout; -} - -declare interface GPUProgrammableStage { - module: GPUShaderModule; - entryPoint: string; -} - -declare class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase { - label: string; - - getBindGroupLayout(index: number): GPUBindGroupLayout; -} - -declare interface GPUComputePipelineDescriptor - extends GPUPipelineDescriptorBase { - compute: GPUProgrammableStage; -} - -declare class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase { - label: string; - - getBindGroupLayout(index: number): GPUBindGroupLayout; -} - -declare interface GPURenderPipelineDescriptor - extends GPUPipelineDescriptorBase { - vertex: GPUVertexState; - primitive?: GPUPrimitiveState; - depthStencil?: GPUDepthStencilState; - multisample?: GPUMultisampleState; - fragment?: GPUFragmentState; -} - -declare interface GPUPrimitiveState { - topology?: GPUPrimitiveTopology; - stripIndexFormat?: GPUIndexFormat; - frontFace?: GPUFrontFace; - cullMode?: GPUCullMode; - unclippedDepth?: boolean; -} - -declare type GPUPrimitiveTopology = - | "point-list" - | "line-list" - | "line-strip" - | "triangle-list" - | "triangle-strip"; - -declare type GPUFrontFace = "ccw" | "cw"; - -declare type GPUCullMode = "none" | "front" | "back"; - -declare interface GPUMultisampleState { - count?: number; - mask?: number; - alphaToCoverageEnabled?: boolean; -} - -declare interface GPUFragmentState extends GPUProgrammableStage { - targets: (GPUColorTargetState | null)[]; -} - -declare interface GPUColorTargetState { - format: GPUTextureFormat; - - blend?: GPUBlendState; - writeMask?: GPUColorWriteFlags; -} - -declare interface GPUBlendState { - color: GPUBlendComponent; - alpha: GPUBlendComponent; -} - -declare type GPUColorWriteFlags = number; -declare class GPUColorWrite { - static RED: 0x1; - static GREEN: 0x2; - static BLUE: 0x4; - static ALPHA: 0x8; - static ALL: 0xF; -} - -declare interface GPUBlendComponent { - operation?: GPUBlendOperation; - srcFactor?: GPUBlendFactor; - dstFactor?: GPUBlendFactor; -} - -declare type GPUBlendFactor = - | "zero" - | "one" - | "src" - | "one-minus-src" - | "src-alpha" - | "one-minus-src-alpha" - | "dst" - | "one-minus-dst" - | "dst-alpha" - | "one-minus-dst-alpha" - | "src-alpha-saturated" - | "constant" - | "one-minus-constant"; - -declare type GPUBlendOperation = - | "add" - | "subtract" - | "reverse-subtract" - | "min" - | "max"; - -declare interface GPUDepthStencilState { - format: GPUTextureFormat; - - depthWriteEnabled?: boolean; - depthCompare?: GPUCompareFunction; - - stencilFront?: GPUStencilFaceState; - stencilBack?: GPUStencilFaceState; - - stencilReadMask?: number; - stencilWriteMask?: number; - - depthBias?: number; - depthBiasSlopeScale?: number; - depthBiasClamp?: number; -} - -declare interface GPUStencilFaceState { - compare?: GPUCompareFunction; - failOp?: GPUStencilOperation; - depthFailOp?: GPUStencilOperation; - passOp?: GPUStencilOperation; -} - -declare type GPUStencilOperation = - | "keep" - | "zero" - | "replace" - | "invert" - | "increment-clamp" - | "decrement-clamp" - | "increment-wrap" - | "decrement-wrap"; - -declare type GPUIndexFormat = "uint16" | "uint32"; - -declare type GPUVertexFormat = - | "uint8x2" - | "uint8x4" - | "sint8x2" - | "sint8x4" - | "unorm8x2" - | "unorm8x4" - | "snorm8x2" - | "snorm8x4" - | "uint16x2" - | "uint16x4" - | "sint16x2" - | "sint16x4" - | "unorm16x2" - | "unorm16x4" - | "snorm16x2" - | "snorm16x4" - | "float16x2" - | "float16x4" - | "float32" - | "float32x2" - | "float32x3" - | "float32x4" - | "uint32" - | "uint32x2" - | "uint32x3" - | "uint32x4" - | "sint32" - | "sint32x2" - | "sint32x3" - | "sint32x4"; -declare type GPUVertexStepMode = "vertex" | "instance"; - -declare interface GPUVertexState extends GPUProgrammableStage { - buffers?: (GPUVertexBufferLayout | null)[]; -} - -declare interface GPUVertexBufferLayout { - arrayStride: number; - stepMode?: GPUVertexStepMode; - attributes: GPUVertexAttribute[]; -} - -declare interface GPUVertexAttribute { - format: GPUVertexFormat; - offset: number; - - shaderLocation: number; -} - -declare class GPUCommandBuffer implements GPUObjectBase { - label: string; -} - -declare interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {} - -declare class GPUCommandEncoder implements GPUObjectBase { - label: string; - - beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder; - beginComputePass( - descriptor?: GPUComputePassDescriptor, - ): GPUComputePassEncoder; - - copyBufferToBuffer( - source: GPUBuffer, - sourceOffset: number, - destination: GPUBuffer, - destinationOffset: number, - size: number, - ): undefined; - - copyBufferToTexture( - source: GPUImageCopyBuffer, - destination: GPUImageCopyTexture, - copySize: GPUExtent3D, - ): undefined; - - copyTextureToBuffer( - source: GPUImageCopyTexture, - destination: GPUImageCopyBuffer, - copySize: GPUExtent3D, - ): undefined; - - copyTextureToTexture( - source: GPUImageCopyTexture, - destination: GPUImageCopyTexture, - copySize: GPUExtent3D, - ): undefined; - - clearBuffer( - destination: GPUBuffer, - destinationOffset?: number, - size?: number, - ): undefined; - - pushDebugGroup(groupLabel: string): undefined; - popDebugGroup(): undefined; - insertDebugMarker(markerLabel: string): undefined; - - writeTimestamp(querySet: GPUQuerySet, queryIndex: number): undefined; - - resolveQuerySet( - querySet: GPUQuerySet, - firstQuery: number, - queryCount: number, - destination: GPUBuffer, - destinationOffset: number, - ): undefined; - - finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer; -} - -declare interface GPUCommandEncoderDescriptor extends GPUObjectDescriptorBase {} - -declare interface GPUImageDataLayout { - offset?: number; - bytesPerRow?: number; - rowsPerImage?: number; -} - -declare interface GPUImageCopyBuffer extends GPUImageDataLayout { - buffer: GPUBuffer; -} - -declare interface GPUImageCopyTexture { - texture: GPUTexture; - mipLevel?: number; - origin?: GPUOrigin3D; - aspect?: GPUTextureAspect; -} - -interface GPUProgrammablePassEncoder { - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsets?: number[], - ): undefined; - - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsetsData: Uint32Array, - dynamicOffsetsDataStart: number, - dynamicOffsetsDataLength: number, - ): undefined; - - pushDebugGroup(groupLabel: string): undefined; - popDebugGroup(): undefined; - insertDebugMarker(markerLabel: string): undefined; -} - -declare class GPUComputePassEncoder - implements GPUObjectBase, GPUProgrammablePassEncoder { - label: string; - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsets?: number[], - ): undefined; - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsetsData: Uint32Array, - dynamicOffsetsDataStart: number, - dynamicOffsetsDataLength: number, - ): undefined; - pushDebugGroup(groupLabel: string): undefined; - popDebugGroup(): undefined; - insertDebugMarker(markerLabel: string): undefined; - setPipeline(pipeline: GPUComputePipeline): undefined; - dispatchWorkgroups(x: number, y?: number, z?: number): undefined; - dispatchWorkgroupsIndirect( - indirectBuffer: GPUBuffer, - indirectOffset: number, - ): undefined; - - beginPipelineStatisticsQuery( - querySet: GPUQuerySet, - queryIndex: number, - ): undefined; - endPipelineStatisticsQuery(): undefined; - - writeTimestamp(querySet: GPUQuerySet, queryIndex: number): undefined; - - end(): undefined; -} - -declare interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {} - -interface GPURenderEncoderBase { - setPipeline(pipeline: GPURenderPipeline): undefined; - - setIndexBuffer( - buffer: GPUBuffer, - indexFormat: GPUIndexFormat, - offset?: number, - size?: number, - ): undefined; - setVertexBuffer( - slot: number, - buffer: GPUBuffer, - offset?: number, - size?: number, - ): undefined; - - draw( - vertexCount: number, - instanceCount?: number, - firstVertex?: number, - firstInstance?: number, - ): undefined; - drawIndexed( - indexCount: number, - instanceCount?: number, - firstIndex?: number, - baseVertex?: number, - firstInstance?: number, - ): undefined; - - drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined; - drawIndexedIndirect( - indirectBuffer: GPUBuffer, - indirectOffset: number, - ): undefined; -} - -declare class GPURenderPassEncoder - implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase { - label: string; - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsets?: number[], - ): undefined; - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsetsData: Uint32Array, - dynamicOffsetsDataStart: number, - dynamicOffsetsDataLength: number, - ): undefined; - pushDebugGroup(groupLabel: string): undefined; - popDebugGroup(): undefined; - insertDebugMarker(markerLabel: string): undefined; - setPipeline(pipeline: GPURenderPipeline): undefined; - setIndexBuffer( - buffer: GPUBuffer, - indexFormat: GPUIndexFormat, - offset?: number, - size?: number, - ): undefined; - setVertexBuffer( - slot: number, - buffer: GPUBuffer, - offset?: number, - size?: number, - ): undefined; - draw( - vertexCount: number, - instanceCount?: number, - firstVertex?: number, - firstInstance?: number, - ): undefined; - drawIndexed( - indexCount: number, - instanceCount?: number, - firstIndex?: number, - baseVertex?: number, - firstInstance?: number, - ): undefined; - drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined; - drawIndexedIndirect( - indirectBuffer: GPUBuffer, - indirectOffset: number, - ): undefined; - - setViewport( - x: number, - y: number, - width: number, - height: number, - minDepth: number, - maxDepth: number, - ): undefined; - - setScissorRect( - x: number, - y: number, - width: number, - height: number, - ): undefined; - - setBlendConstant(color: GPUColor): undefined; - setStencilReference(reference: number): undefined; - - beginOcclusionQuery(queryIndex: number): undefined; - endOcclusionQuery(): undefined; - - beginPipelineStatisticsQuery( - querySet: GPUQuerySet, - queryIndex: number, - ): undefined; - endPipelineStatisticsQuery(): undefined; - - writeTimestamp(querySet: GPUQuerySet, queryIndex: number): undefined; - - executeBundles(bundles: GPURenderBundle[]): undefined; - end(): undefined; -} - -declare interface GPURenderPassDescriptor extends GPUObjectDescriptorBase { - colorAttachments: (GPURenderPassColorAttachment | null)[]; - depthStencilAttachment?: GPURenderPassDepthStencilAttachment; - occlusionQuerySet?: GPUQuerySet; -} - -declare interface GPURenderPassColorAttachment { - view: GPUTextureView; - resolveTarget?: GPUTextureView; - - clearValue?: GPUColor; - loadOp: GPULoadOp; - storeOp: GPUStoreOp; -} - -declare interface GPURenderPassDepthStencilAttachment { - view: GPUTextureView; - - depthClearValue?: number; - depthLoadOp?: GPULoadOp; - depthStoreOp?: GPUStoreOp; - depthReadOnly?: boolean; - - stencilClearValue?: number; - stencilLoadOp?: GPULoadOp; - stencilStoreOp?: GPUStoreOp; - stencilReadOnly?: boolean; -} - -declare type GPULoadOp = "load" | "clear"; - -declare type GPUStoreOp = "store" | "discard"; - -declare class GPURenderBundle implements GPUObjectBase { - label: string; -} - -declare interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {} - -declare class GPURenderBundleEncoder - implements GPUObjectBase, GPUProgrammablePassEncoder, GPURenderEncoderBase { - label: string; - draw( - vertexCount: number, - instanceCount?: number, - firstVertex?: number, - firstInstance?: number, - ): undefined; - drawIndexed( - indexCount: number, - instanceCount?: number, - firstIndex?: number, - baseVertex?: number, - firstInstance?: number, - ): undefined; - drawIndexedIndirect( - indirectBuffer: GPUBuffer, - indirectOffset: number, - ): undefined; - drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined; - insertDebugMarker(markerLabel: string): undefined; - popDebugGroup(): undefined; - pushDebugGroup(groupLabel: string): undefined; - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsets?: number[], - ): undefined; - setBindGroup( - index: number, - bindGroup: GPUBindGroup, - dynamicOffsetsData: Uint32Array, - dynamicOffsetsDataStart: number, - dynamicOffsetsDataLength: number, - ): undefined; - setIndexBuffer( - buffer: GPUBuffer, - indexFormat: GPUIndexFormat, - offset?: number, - size?: number, - ): undefined; - setPipeline(pipeline: GPURenderPipeline): undefined; - setVertexBuffer( - slot: number, - buffer: GPUBuffer, - offset?: number, - size?: number, - ): undefined; - - finish(descriptor?: GPURenderBundleDescriptor): GPURenderBundle; -} - -declare interface GPURenderPassLayout extends GPUObjectDescriptorBase { - colorFormats: (GPUTextureFormat | null)[]; - depthStencilFormat?: GPUTextureFormat; - sampleCount?: number; -} - -declare interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout { - depthReadOnly?: boolean; - stencilReadOnly?: boolean; -} - -declare class GPUQueue implements GPUObjectBase { - label: string; - - submit(commandBuffers: GPUCommandBuffer[]): undefined; - - onSubmittedWorkDone(): Promise; - - writeBuffer( - buffer: GPUBuffer, - bufferOffset: number, - data: BufferSource, - dataOffset?: number, - size?: number, - ): undefined; - - writeTexture( - destination: GPUImageCopyTexture, - data: BufferSource, - dataLayout: GPUImageDataLayout, - size: GPUExtent3D, - ): undefined; -} - -declare class GPUQuerySet implements GPUObjectBase { - label: string; - - destroy(): undefined; -} - -declare interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase { - type: GPUQueryType; - count: number; - pipelineStatistics?: GPUPipelineStatisticName[]; -} - -declare type GPUQueryType = "occlusion" | "pipeline-statistics" | "timestamp"; - -declare type GPUPipelineStatisticName = - | "vertex-shader-invocations" - | "clipper-invocations" - | "clipper-primitives-out" - | "fragment-shader-invocations" - | "compute-shader-invocations"; - -declare type GPUDeviceLostReason = "destroyed"; - -declare interface GPUDeviceLostInfo { - readonly reason: GPUDeviceLostReason | undefined; - readonly message: string; -} - -declare class GPUError { - readonly message: string; -} - -declare type GPUErrorFilter = "out-of-memory" | "validation"; - -declare class GPUOutOfMemoryError extends GPUError { - constructor(message: string); -} - -declare class GPUValidationError extends GPUError { - constructor(message: string); -} - -declare class GPUUncapturedErrorEvent extends Event { - constructor( - type: string, - gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit, - ); - readonly error: GPUError; -} - -declare interface GPUUncapturedErrorEventInit extends EventInit { - error?: GPUError; -} - -declare interface GPUColorDict { - r: number; - g: number; - b: number; - a: number; -} - -declare type GPUColor = number[] | GPUColorDict; - -declare interface GPUOrigin3DDict { - x?: number; - y?: number; - z?: number; -} - -declare type GPUOrigin3D = number[] | GPUOrigin3DDict; - -declare interface GPUExtent3DDict { - width: number; - height?: number; - depthOrArrayLayers?: number; -} - -declare type GPUExtent3D = number[] | GPUExtent3DDict; diff --git a/components/clarinet-cli/dts/lib.dom.asynciterable.d.ts b/components/clarinet-cli/dts/lib.dom.asynciterable.d.ts deleted file mode 100644 index 27f9f3ede..000000000 --- a/components/clarinet-cli/dts/lib.dom.asynciterable.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -/// - -interface ReadableStream { - [Symbol.asyncIterator](options?: { - preventCancel?: boolean; - }): AsyncIterableIterator; -} diff --git a/components/clarinet-cli/dts/lib.dom.d.ts b/components/clarinet-cli/dts/lib.dom.d.ts deleted file mode 100644 index 7d8f7e3e1..000000000 --- a/components/clarinet-cli/dts/lib.dom.d.ts +++ /dev/null @@ -1,18323 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - - -/// -/// - -///////////////////////////// -/// Window APIs -///////////////////////////// - -interface AddEventListenerOptions extends EventListenerOptions { - once?: boolean; - passive?: boolean; - signal?: AbortSignal; -} - -interface AesCbcParams extends Algorithm { - iv: BufferSource; -} - -interface AesCtrParams extends Algorithm { - counter: BufferSource; - length: number; -} - -interface AesDerivedKeyParams extends Algorithm { - length: number; -} - -interface AesGcmParams extends Algorithm { - additionalData?: BufferSource; - iv: BufferSource; - tagLength?: number; -} - -interface AesKeyAlgorithm extends KeyAlgorithm { - length: number; -} - -interface AesKeyGenParams extends Algorithm { - length: number; -} - -interface Algorithm { - name: string; -} - -interface AnalyserOptions extends AudioNodeOptions { - fftSize?: number; - maxDecibels?: number; - minDecibels?: number; - smoothingTimeConstant?: number; -} - -interface AnimationEventInit extends EventInit { - animationName?: string; - elapsedTime?: number; - pseudoElement?: string; -} - -interface AnimationPlaybackEventInit extends EventInit { - currentTime?: CSSNumberish | null; - timelineTime?: CSSNumberish | null; -} - -interface AssignedNodesOptions { - flatten?: boolean; -} - -interface AudioBufferOptions { - length: number; - numberOfChannels?: number; - sampleRate: number; -} - -interface AudioBufferSourceOptions { - buffer?: AudioBuffer | null; - detune?: number; - loop?: boolean; - loopEnd?: number; - loopStart?: number; - playbackRate?: number; -} - -interface AudioConfiguration { - bitrate?: number; - channels?: string; - contentType: string; - samplerate?: number; - spatialRendering?: boolean; -} - -interface AudioContextOptions { - latencyHint?: AudioContextLatencyCategory | number; - sampleRate?: number; -} - -interface AudioNodeOptions { - channelCount?: number; - channelCountMode?: ChannelCountMode; - channelInterpretation?: ChannelInterpretation; -} - -interface AudioProcessingEventInit extends EventInit { - inputBuffer: AudioBuffer; - outputBuffer: AudioBuffer; - playbackTime: number; -} - -interface AudioTimestamp { - contextTime?: number; - performanceTime?: DOMHighResTimeStamp; -} - -interface AudioWorkletNodeOptions extends AudioNodeOptions { - numberOfInputs?: number; - numberOfOutputs?: number; - outputChannelCount?: number[]; - parameterData?: Record; - processorOptions?: any; -} - -interface AuthenticationExtensionsClientInputs { - appid?: string; - appidExclude?: string; - credProps?: boolean; - uvm?: boolean; -} - -interface AuthenticationExtensionsClientOutputs { - appid?: boolean; - credProps?: CredentialPropertiesOutput; - uvm?: UvmEntries; -} - -interface AuthenticatorSelectionCriteria { - authenticatorAttachment?: AuthenticatorAttachment; - requireResidentKey?: boolean; - residentKey?: ResidentKeyRequirement; - userVerification?: UserVerificationRequirement; -} - -interface BiquadFilterOptions extends AudioNodeOptions { - Q?: number; - detune?: number; - frequency?: number; - gain?: number; - type?: BiquadFilterType; -} - -interface BlobEventInit { - data: Blob; - timecode?: DOMHighResTimeStamp; -} - -interface BlobPropertyBag { - endings?: EndingType; - type?: string; -} - -interface CSSStyleSheetInit { - baseURL?: string; - disabled?: boolean; - media?: MediaList | string; -} - -interface CacheQueryOptions { - ignoreMethod?: boolean; - ignoreSearch?: boolean; - ignoreVary?: boolean; -} - -interface CanvasRenderingContext2DSettings { - alpha?: boolean; - colorSpace?: PredefinedColorSpace; - desynchronized?: boolean; - willReadFrequently?: boolean; -} - -interface ChannelMergerOptions extends AudioNodeOptions { - numberOfInputs?: number; -} - -interface ChannelSplitterOptions extends AudioNodeOptions { - numberOfOutputs?: number; -} - -interface ClientQueryOptions { - includeUncontrolled?: boolean; - type?: ClientTypes; -} - -interface ClipboardEventInit extends EventInit { - clipboardData?: DataTransfer | null; -} - -interface ClipboardItemOptions { - presentationStyle?: PresentationStyle; -} - -interface CloseEventInit extends EventInit { - code?: number; - reason?: string; - wasClean?: boolean; -} - -interface CompositionEventInit extends UIEventInit { - data?: string; -} - -interface ComputedEffectTiming extends EffectTiming { - activeDuration?: CSSNumberish; - currentIteration?: number | null; - endTime?: CSSNumberish; - localTime?: CSSNumberish | null; - progress?: number | null; - startTime?: CSSNumberish; -} - -interface ComputedKeyframe { - composite: CompositeOperationOrAuto; - computedOffset: number; - easing: string; - offset: number | null; - [property: string]: string | number | null | undefined; -} - -interface ConstantSourceOptions { - offset?: number; -} - -interface ConstrainBooleanParameters { - exact?: boolean; - ideal?: boolean; -} - -interface ConstrainDOMStringParameters { - exact?: string | string[]; - ideal?: string | string[]; -} - -interface ConstrainDoubleRange extends DoubleRange { - exact?: number; - ideal?: number; -} - -interface ConstrainULongRange extends ULongRange { - exact?: number; - ideal?: number; -} - -interface ConvolverOptions extends AudioNodeOptions { - buffer?: AudioBuffer | null; - disableNormalization?: boolean; -} - -interface CredentialCreationOptions { - publicKey?: PublicKeyCredentialCreationOptions; - signal?: AbortSignal; -} - -interface CredentialPropertiesOutput { - rk?: boolean; -} - -interface CredentialRequestOptions { - mediation?: CredentialMediationRequirement; - publicKey?: PublicKeyCredentialRequestOptions; - signal?: AbortSignal; -} - -interface CryptoKeyPair { - privateKey: CryptoKey; - publicKey: CryptoKey; -} - -interface CustomEventInit extends EventInit { - detail?: T; -} - -interface DOMMatrix2DInit { - a?: number; - b?: number; - c?: number; - d?: number; - e?: number; - f?: number; - m11?: number; - m12?: number; - m21?: number; - m22?: number; - m41?: number; - m42?: number; -} - -interface DOMMatrixInit extends DOMMatrix2DInit { - is2D?: boolean; - m13?: number; - m14?: number; - m23?: number; - m24?: number; - m31?: number; - m32?: number; - m33?: number; - m34?: number; - m43?: number; - m44?: number; -} - -interface DOMPointInit { - w?: number; - x?: number; - y?: number; - z?: number; -} - -interface DOMQuadInit { - p1?: DOMPointInit; - p2?: DOMPointInit; - p3?: DOMPointInit; - p4?: DOMPointInit; -} - -interface DOMRectInit { - height?: number; - width?: number; - x?: number; - y?: number; -} - -interface DelayOptions extends AudioNodeOptions { - delayTime?: number; - maxDelayTime?: number; -} - -interface DeviceMotionEventAccelerationInit { - x?: number | null; - y?: number | null; - z?: number | null; -} - -interface DeviceMotionEventInit extends EventInit { - acceleration?: DeviceMotionEventAccelerationInit; - accelerationIncludingGravity?: DeviceMotionEventAccelerationInit; - interval?: number; - rotationRate?: DeviceMotionEventRotationRateInit; -} - -interface DeviceMotionEventRotationRateInit { - alpha?: number | null; - beta?: number | null; - gamma?: number | null; -} - -interface DeviceOrientationEventInit extends EventInit { - absolute?: boolean; - alpha?: number | null; - beta?: number | null; - gamma?: number | null; -} - -interface DisplayMediaStreamConstraints { - audio?: boolean | MediaTrackConstraints; - video?: boolean | MediaTrackConstraints; -} - -interface DocumentTimelineOptions { - originTime?: DOMHighResTimeStamp; -} - -interface DoubleRange { - max?: number; - min?: number; -} - -interface DragEventInit extends MouseEventInit { - dataTransfer?: DataTransfer | null; -} - -interface DynamicsCompressorOptions extends AudioNodeOptions { - attack?: number; - knee?: number; - ratio?: number; - release?: number; - threshold?: number; -} - -interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: NamedCurve; -} - -interface EcKeyGenParams extends Algorithm { - namedCurve: NamedCurve; -} - -interface EcKeyImportParams extends Algorithm { - namedCurve: NamedCurve; -} - -interface EcdhKeyDeriveParams extends Algorithm { - public: CryptoKey; -} - -interface EcdsaParams extends Algorithm { - hash: HashAlgorithmIdentifier; -} - -interface EffectTiming { - delay?: number; - direction?: PlaybackDirection; - duration?: number | string; - easing?: string; - endDelay?: number; - fill?: FillMode; - iterationStart?: number; - iterations?: number; - playbackRate?: number; -} - -interface ElementCreationOptions { - is?: string; -} - -interface ElementDefinitionOptions { - extends?: string; -} - -interface ErrorEventInit extends EventInit { - colno?: number; - error?: any; - filename?: string; - lineno?: number; - message?: string; -} - -interface EventInit { - bubbles?: boolean; - cancelable?: boolean; - composed?: boolean; -} - -interface EventListenerOptions { - capture?: boolean; -} - -interface EventModifierInit extends UIEventInit { - altKey?: boolean; - ctrlKey?: boolean; - metaKey?: boolean; - modifierAltGraph?: boolean; - modifierCapsLock?: boolean; - modifierFn?: boolean; - modifierFnLock?: boolean; - modifierHyper?: boolean; - modifierNumLock?: boolean; - modifierScrollLock?: boolean; - modifierSuper?: boolean; - modifierSymbol?: boolean; - modifierSymbolLock?: boolean; - shiftKey?: boolean; -} - -interface EventSourceInit { - withCredentials?: boolean; -} - -interface FilePropertyBag extends BlobPropertyBag { - lastModified?: number; -} - -interface FileSystemFlags { - create?: boolean; - exclusive?: boolean; -} - -interface FileSystemGetDirectoryOptions { - create?: boolean; -} - -interface FileSystemGetFileOptions { - create?: boolean; -} - -interface FileSystemRemoveOptions { - recursive?: boolean; -} - -interface FocusEventInit extends UIEventInit { - relatedTarget?: EventTarget | null; -} - -interface FocusOptions { - preventScroll?: boolean; -} - -interface FontFaceDescriptors { - display?: string; - featureSettings?: string; - stretch?: string; - style?: string; - unicodeRange?: string; - variant?: string; - weight?: string; -} - -interface FontFaceSetLoadEventInit extends EventInit { - fontfaces?: FontFace[]; -} - -interface FormDataEventInit extends EventInit { - formData: FormData; -} - -interface FullscreenOptions { - navigationUI?: FullscreenNavigationUI; -} - -interface GainOptions extends AudioNodeOptions { - gain?: number; -} - -interface GamepadEventInit extends EventInit { - gamepad: Gamepad; -} - -interface GetAnimationsOptions { - subtree?: boolean; -} - -interface GetNotificationOptions { - tag?: string; -} - -interface GetRootNodeOptions { - composed?: boolean; -} - -interface HashChangeEventInit extends EventInit { - newURL?: string; - oldURL?: string; -} - -interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: BufferSource; - salt: BufferSource; -} - -interface HmacImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; -} - -interface HmacKeyAlgorithm extends KeyAlgorithm { - hash: KeyAlgorithm; - length: number; -} - -interface HmacKeyGenParams extends Algorithm { - hash: HashAlgorithmIdentifier; - length?: number; -} - -interface IDBDatabaseInfo { - name?: string; - version?: number; -} - -interface IDBIndexParameters { - multiEntry?: boolean; - unique?: boolean; -} - -interface IDBObjectStoreParameters { - autoIncrement?: boolean; - keyPath?: string | string[] | null; -} - -interface IDBVersionChangeEventInit extends EventInit { - newVersion?: number | null; - oldVersion?: number; -} - -interface IIRFilterOptions extends AudioNodeOptions { - feedback: number[]; - feedforward: number[]; -} - -interface IdleRequestOptions { - timeout?: number; -} - -interface ImageBitmapOptions { - colorSpaceConversion?: ColorSpaceConversion; - imageOrientation?: ImageOrientation; - premultiplyAlpha?: PremultiplyAlpha; - resizeHeight?: number; - resizeQuality?: ResizeQuality; - resizeWidth?: number; -} - -interface ImageBitmapRenderingContextSettings { - alpha?: boolean; -} - -interface ImageDataSettings { - colorSpace?: PredefinedColorSpace; -} - -interface ImportMeta { - url: string; -} - -interface InputEventInit extends UIEventInit { - data?: string | null; - dataTransfer?: DataTransfer | null; - inputType?: string; - isComposing?: boolean; - targetRanges?: StaticRange[]; -} - -interface IntersectionObserverEntryInit { - boundingClientRect: DOMRectInit; - intersectionRatio: number; - intersectionRect: DOMRectInit; - isIntersecting: boolean; - rootBounds: DOMRectInit | null; - target: Element; - time: DOMHighResTimeStamp; -} - -interface IntersectionObserverInit { - root?: Element | Document | null; - rootMargin?: string; - threshold?: number | number[]; -} - -interface JsonWebKey { - alg?: string; - crv?: string; - d?: string; - dp?: string; - dq?: string; - e?: string; - ext?: boolean; - k?: string; - key_ops?: string[]; - kty?: string; - n?: string; - oth?: RsaOtherPrimesInfo[]; - p?: string; - q?: string; - qi?: string; - use?: string; - x?: string; - y?: string; -} - -interface KeyAlgorithm { - name: string; -} - -interface KeyboardEventInit extends EventModifierInit { - /** @deprecated */ - charCode?: number; - code?: string; - isComposing?: boolean; - key?: string; - /** @deprecated */ - keyCode?: number; - location?: number; - repeat?: boolean; -} - -interface Keyframe { - composite?: CompositeOperationOrAuto; - easing?: string; - offset?: number | null; - [property: string]: string | number | null | undefined; -} - -interface KeyframeAnimationOptions extends KeyframeEffectOptions { - id?: string; -} - -interface KeyframeEffectOptions extends EffectTiming { - composite?: CompositeOperation; - iterationComposite?: IterationCompositeOperation; - pseudoElement?: string | null; -} - -interface LockInfo { - clientId?: string; - mode?: LockMode; - name?: string; -} - -interface LockManagerSnapshot { - held?: LockInfo[]; - pending?: LockInfo[]; -} - -interface LockOptions { - ifAvailable?: boolean; - mode?: LockMode; - signal?: AbortSignal; - steal?: boolean; -} - -interface MIDIConnectionEventInit extends EventInit { - port?: MIDIPort; -} - -interface MIDIMessageEventInit extends EventInit { - data?: Uint8Array; -} - -interface MIDIOptions { - software?: boolean; - sysex?: boolean; -} - -interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { - configuration?: MediaDecodingConfiguration; -} - -interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { - configuration?: MediaEncodingConfiguration; -} - -interface MediaCapabilitiesInfo { - powerEfficient: boolean; - smooth: boolean; - supported: boolean; -} - -interface MediaConfiguration { - audio?: AudioConfiguration; - video?: VideoConfiguration; -} - -interface MediaDecodingConfiguration extends MediaConfiguration { - type: MediaDecodingType; -} - -interface MediaElementAudioSourceOptions { - mediaElement: HTMLMediaElement; -} - -interface MediaEncodingConfiguration extends MediaConfiguration { - type: MediaEncodingType; -} - -interface MediaEncryptedEventInit extends EventInit { - initData?: ArrayBuffer | null; - initDataType?: string; -} - -interface MediaImage { - sizes?: string; - src: string; - type?: string; -} - -interface MediaKeyMessageEventInit extends EventInit { - message: ArrayBuffer; - messageType: MediaKeyMessageType; -} - -interface MediaKeySystemConfiguration { - audioCapabilities?: MediaKeySystemMediaCapability[]; - distinctiveIdentifier?: MediaKeysRequirement; - initDataTypes?: string[]; - label?: string; - persistentState?: MediaKeysRequirement; - sessionTypes?: string[]; - videoCapabilities?: MediaKeySystemMediaCapability[]; -} - -interface MediaKeySystemMediaCapability { - contentType?: string; - encryptionScheme?: string | null; - robustness?: string; -} - -interface MediaMetadataInit { - album?: string; - artist?: string; - artwork?: MediaImage[]; - title?: string; -} - -interface MediaPositionState { - duration?: number; - playbackRate?: number; - position?: number; -} - -interface MediaQueryListEventInit extends EventInit { - matches?: boolean; - media?: string; -} - -interface MediaRecorderErrorEventInit extends EventInit { - error: DOMException; -} - -interface MediaRecorderOptions { - audioBitsPerSecond?: number; - bitsPerSecond?: number; - mimeType?: string; - videoBitsPerSecond?: number; -} - -interface MediaSessionActionDetails { - action: MediaSessionAction; - fastSeek?: boolean | null; - seekOffset?: number | null; - seekTime?: number | null; -} - -interface MediaStreamAudioSourceOptions { - mediaStream: MediaStream; -} - -interface MediaStreamConstraints { - audio?: boolean | MediaTrackConstraints; - peerIdentity?: string; - preferCurrentTab?: boolean; - video?: boolean | MediaTrackConstraints; -} - -interface MediaStreamTrackEventInit extends EventInit { - track: MediaStreamTrack; -} - -interface MediaTrackCapabilities { - aspectRatio?: DoubleRange; - autoGainControl?: boolean[]; - channelCount?: ULongRange; - cursor?: string[]; - deviceId?: string; - displaySurface?: string; - echoCancellation?: boolean[]; - facingMode?: string[]; - frameRate?: DoubleRange; - groupId?: string; - height?: ULongRange; - latency?: DoubleRange; - logicalSurface?: boolean; - noiseSuppression?: boolean[]; - resizeMode?: string[]; - sampleRate?: ULongRange; - sampleSize?: ULongRange; - width?: ULongRange; -} - -interface MediaTrackConstraintSet { - aspectRatio?: ConstrainDouble; - autoGainControl?: ConstrainBoolean; - channelCount?: ConstrainULong; - deviceId?: ConstrainDOMString; - echoCancellation?: ConstrainBoolean; - facingMode?: ConstrainDOMString; - frameRate?: ConstrainDouble; - groupId?: ConstrainDOMString; - height?: ConstrainULong; - latency?: ConstrainDouble; - noiseSuppression?: ConstrainBoolean; - sampleRate?: ConstrainULong; - sampleSize?: ConstrainULong; - suppressLocalAudioPlayback?: ConstrainBoolean; - width?: ConstrainULong; -} - -interface MediaTrackConstraints extends MediaTrackConstraintSet { - advanced?: MediaTrackConstraintSet[]; -} - -interface MediaTrackSettings { - aspectRatio?: number; - autoGainControl?: boolean; - deviceId?: string; - echoCancellation?: boolean; - facingMode?: string; - frameRate?: number; - groupId?: string; - height?: number; - noiseSuppression?: boolean; - restrictOwnAudio?: boolean; - sampleRate?: number; - sampleSize?: number; - width?: number; -} - -interface MediaTrackSupportedConstraints { - aspectRatio?: boolean; - autoGainControl?: boolean; - deviceId?: boolean; - echoCancellation?: boolean; - facingMode?: boolean; - frameRate?: boolean; - groupId?: boolean; - height?: boolean; - noiseSuppression?: boolean; - sampleRate?: boolean; - sampleSize?: boolean; - suppressLocalAudioPlayback?: boolean; - width?: boolean; -} - -interface MessageEventInit extends EventInit { - data?: T; - lastEventId?: string; - origin?: string; - ports?: MessagePort[]; - source?: MessageEventSource | null; -} - -interface MouseEventInit extends EventModifierInit { - button?: number; - buttons?: number; - clientX?: number; - clientY?: number; - movementX?: number; - movementY?: number; - relatedTarget?: EventTarget | null; - screenX?: number; - screenY?: number; -} - -interface MultiCacheQueryOptions extends CacheQueryOptions { - cacheName?: string; -} - -interface MutationObserverInit { - /** Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted. */ - attributeFilter?: string[]; - /** Set to true if attributes is true or omitted and target's attribute value before the mutation needs to be recorded. */ - attributeOldValue?: boolean; - /** Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is specified. */ - attributes?: boolean; - /** Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified. */ - characterData?: boolean; - /** Set to true if characterData is set to true or omitted and target's data before the mutation needs to be recorded. */ - characterDataOldValue?: boolean; - /** Set to true if mutations to target's children are to be observed. */ - childList?: boolean; - /** Set to true if mutations to not just target, but also target's descendants are to be observed. */ - subtree?: boolean; -} - -interface NavigationPreloadState { - enabled?: boolean; - headerValue?: string; -} - -interface NotificationAction { - action: string; - icon?: string; - title: string; -} - -interface NotificationOptions { - actions?: NotificationAction[]; - badge?: string; - body?: string; - data?: any; - dir?: NotificationDirection; - icon?: string; - image?: string; - lang?: string; - renotify?: boolean; - requireInteraction?: boolean; - silent?: boolean; - tag?: string; - timestamp?: EpochTimeStamp; - vibrate?: VibratePattern; -} - -interface OfflineAudioCompletionEventInit extends EventInit { - renderedBuffer: AudioBuffer; -} - -interface OfflineAudioContextOptions { - length: number; - numberOfChannels?: number; - sampleRate: number; -} - -interface OptionalEffectTiming { - delay?: number; - direction?: PlaybackDirection; - duration?: number | string; - easing?: string; - endDelay?: number; - fill?: FillMode; - iterationStart?: number; - iterations?: number; - playbackRate?: number; -} - -interface OscillatorOptions extends AudioNodeOptions { - detune?: number; - frequency?: number; - periodicWave?: PeriodicWave; - type?: OscillatorType; -} - -interface PageTransitionEventInit extends EventInit { - persisted?: boolean; -} - -interface PannerOptions extends AudioNodeOptions { - coneInnerAngle?: number; - coneOuterAngle?: number; - coneOuterGain?: number; - distanceModel?: DistanceModelType; - maxDistance?: number; - orientationX?: number; - orientationY?: number; - orientationZ?: number; - panningModel?: PanningModelType; - positionX?: number; - positionY?: number; - positionZ?: number; - refDistance?: number; - rolloffFactor?: number; -} - -interface PaymentCurrencyAmount { - currency: string; - value: string; -} - -interface PaymentDetailsBase { - displayItems?: PaymentItem[]; - modifiers?: PaymentDetailsModifier[]; -} - -interface PaymentDetailsInit extends PaymentDetailsBase { - id?: string; - total: PaymentItem; -} - -interface PaymentDetailsModifier { - additionalDisplayItems?: PaymentItem[]; - data?: any; - supportedMethods: string; - total?: PaymentItem; -} - -interface PaymentDetailsUpdate extends PaymentDetailsBase { - paymentMethodErrors?: any; - total?: PaymentItem; -} - -interface PaymentItem { - amount: PaymentCurrencyAmount; - label: string; - pending?: boolean; -} - -interface PaymentMethodChangeEventInit extends PaymentRequestUpdateEventInit { - methodDetails?: any; - methodName?: string; -} - -interface PaymentMethodData { - data?: any; - supportedMethods: string; -} - -interface PaymentRequestUpdateEventInit extends EventInit { -} - -interface PaymentValidationErrors { - error?: string; - paymentMethod?: any; -} - -interface Pbkdf2Params extends Algorithm { - hash: HashAlgorithmIdentifier; - iterations: number; - salt: BufferSource; -} - -interface PerformanceMarkOptions { - detail?: any; - startTime?: DOMHighResTimeStamp; -} - -interface PerformanceMeasureOptions { - detail?: any; - duration?: DOMHighResTimeStamp; - end?: string | DOMHighResTimeStamp; - start?: string | DOMHighResTimeStamp; -} - -interface PerformanceObserverInit { - buffered?: boolean; - entryTypes?: string[]; - type?: string; -} - -interface PeriodicWaveConstraints { - disableNormalization?: boolean; -} - -interface PeriodicWaveOptions extends PeriodicWaveConstraints { - imag?: number[] | Float32Array; - real?: number[] | Float32Array; -} - -interface PermissionDescriptor { - name: PermissionName; -} - -interface PointerEventInit extends MouseEventInit { - coalescedEvents?: PointerEvent[]; - height?: number; - isPrimary?: boolean; - pointerId?: number; - pointerType?: string; - predictedEvents?: PointerEvent[]; - pressure?: number; - tangentialPressure?: number; - tiltX?: number; - tiltY?: number; - twist?: number; - width?: number; -} - -interface PopStateEventInit extends EventInit { - state?: any; -} - -interface PositionOptions { - enableHighAccuracy?: boolean; - maximumAge?: number; - timeout?: number; -} - -interface ProgressEventInit extends EventInit { - lengthComputable?: boolean; - loaded?: number; - total?: number; -} - -interface PromiseRejectionEventInit extends EventInit { - promise: Promise; - reason?: any; -} - -interface PropertyIndexedKeyframes { - composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[]; - easing?: string | string[]; - offset?: number | (number | null)[]; - [property: string]: string | string[] | number | null | (number | null)[] | undefined; -} - -interface PublicKeyCredentialCreationOptions { - attestation?: AttestationConveyancePreference; - authenticatorSelection?: AuthenticatorSelectionCriteria; - challenge: BufferSource; - excludeCredentials?: PublicKeyCredentialDescriptor[]; - extensions?: AuthenticationExtensionsClientInputs; - pubKeyCredParams: PublicKeyCredentialParameters[]; - rp: PublicKeyCredentialRpEntity; - timeout?: number; - user: PublicKeyCredentialUserEntity; -} - -interface PublicKeyCredentialDescriptor { - id: BufferSource; - transports?: AuthenticatorTransport[]; - type: PublicKeyCredentialType; -} - -interface PublicKeyCredentialEntity { - name: string; -} - -interface PublicKeyCredentialParameters { - alg: COSEAlgorithmIdentifier; - type: PublicKeyCredentialType; -} - -interface PublicKeyCredentialRequestOptions { - allowCredentials?: PublicKeyCredentialDescriptor[]; - challenge: BufferSource; - extensions?: AuthenticationExtensionsClientInputs; - rpId?: string; - timeout?: number; - userVerification?: UserVerificationRequirement; -} - -interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { - id?: string; -} - -interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { - displayName: string; - id: BufferSource; -} - -interface PushSubscriptionJSON { - endpoint?: string; - expirationTime?: EpochTimeStamp | null; - keys?: Record; -} - -interface PushSubscriptionOptionsInit { - applicationServerKey?: BufferSource | string | null; - userVisibleOnly?: boolean; -} - -interface QueuingStrategy { - highWaterMark?: number; - size?: QueuingStrategySize; -} - -interface QueuingStrategyInit { - /** - * Creates a new ByteLengthQueuingStrategy with the provided high water mark. - * - * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. - */ - highWaterMark: number; -} - -interface RTCAnswerOptions extends RTCOfferAnswerOptions { -} - -interface RTCCertificateExpiration { - expires?: number; -} - -interface RTCConfiguration { - bundlePolicy?: RTCBundlePolicy; - certificates?: RTCCertificate[]; - iceCandidatePoolSize?: number; - iceServers?: RTCIceServer[]; - iceTransportPolicy?: RTCIceTransportPolicy; - rtcpMuxPolicy?: RTCRtcpMuxPolicy; -} - -interface RTCDTMFToneChangeEventInit extends EventInit { - tone?: string; -} - -interface RTCDataChannelEventInit extends EventInit { - channel: RTCDataChannel; -} - -interface RTCDataChannelInit { - id?: number; - maxPacketLifeTime?: number; - maxRetransmits?: number; - negotiated?: boolean; - ordered?: boolean; - protocol?: string; -} - -interface RTCDtlsFingerprint { - algorithm?: string; - value?: string; -} - -interface RTCEncodedAudioFrameMetadata { - contributingSources?: number[]; - synchronizationSource?: number; -} - -interface RTCEncodedVideoFrameMetadata { - contributingSources?: number[]; - dependencies?: number[]; - frameId?: number; - height?: number; - spatialIndex?: number; - synchronizationSource?: number; - temporalIndex?: number; - width?: number; -} - -interface RTCErrorEventInit extends EventInit { - error: RTCError; -} - -interface RTCErrorInit { - errorDetail: RTCErrorDetailType; - httpRequestStatusCode?: number; - receivedAlert?: number; - sctpCauseCode?: number; - sdpLineNumber?: number; - sentAlert?: number; -} - -interface RTCIceCandidateInit { - candidate?: string; - sdpMLineIndex?: number | null; - sdpMid?: string | null; - usernameFragment?: string | null; -} - -interface RTCIceCandidatePairStats extends RTCStats { - availableIncomingBitrate?: number; - availableOutgoingBitrate?: number; - bytesReceived?: number; - bytesSent?: number; - currentRoundTripTime?: number; - localCandidateId: string; - nominated?: boolean; - remoteCandidateId: string; - requestsReceived?: number; - requestsSent?: number; - responsesReceived?: number; - responsesSent?: number; - state: RTCStatsIceCandidatePairState; - totalRoundTripTime?: number; - transportId: string; -} - -interface RTCIceServer { - credential?: string; - credentialType?: RTCIceCredentialType; - urls: string | string[]; - username?: string; -} - -interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats { - firCount?: number; - framesDecoded?: number; - nackCount?: number; - pliCount?: number; - qpSum?: number; - remoteId?: string; -} - -interface RTCLocalSessionDescriptionInit { - sdp?: string; - type?: RTCSdpType; -} - -interface RTCOfferAnswerOptions { -} - -interface RTCOfferOptions extends RTCOfferAnswerOptions { - iceRestart?: boolean; - offerToReceiveAudio?: boolean; - offerToReceiveVideo?: boolean; -} - -interface RTCOutboundRtpStreamStats extends RTCSentRtpStreamStats { - firCount?: number; - framesEncoded?: number; - nackCount?: number; - pliCount?: number; - qpSum?: number; - remoteId?: string; -} - -interface RTCPeerConnectionIceErrorEventInit extends EventInit { - address?: string | null; - errorCode: number; - errorText?: string; - port?: number | null; - url?: string; -} - -interface RTCPeerConnectionIceEventInit extends EventInit { - candidate?: RTCIceCandidate | null; - url?: string | null; -} - -interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats { - jitter?: number; - packetsDiscarded?: number; - packetsLost?: number; - packetsReceived?: number; -} - -interface RTCRtcpParameters { - cname?: string; - reducedSize?: boolean; -} - -interface RTCRtpCapabilities { - codecs: RTCRtpCodecCapability[]; - headerExtensions: RTCRtpHeaderExtensionCapability[]; -} - -interface RTCRtpCodecCapability { - channels?: number; - clockRate: number; - mimeType: string; - sdpFmtpLine?: string; -} - -interface RTCRtpCodecParameters { - channels?: number; - clockRate: number; - mimeType: string; - payloadType: number; - sdpFmtpLine?: string; -} - -interface RTCRtpCodingParameters { - rid?: string; -} - -interface RTCRtpContributingSource { - audioLevel?: number; - rtpTimestamp: number; - source: number; - timestamp: DOMHighResTimeStamp; -} - -interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { - active?: boolean; - maxBitrate?: number; - priority?: RTCPriorityType; - scaleResolutionDownBy?: number; -} - -interface RTCRtpHeaderExtensionCapability { - uri?: string; -} - -interface RTCRtpHeaderExtensionParameters { - encrypted?: boolean; - id: number; - uri: string; -} - -interface RTCRtpParameters { - codecs: RTCRtpCodecParameters[]; - headerExtensions: RTCRtpHeaderExtensionParameters[]; - rtcp: RTCRtcpParameters; -} - -interface RTCRtpReceiveParameters extends RTCRtpParameters { -} - -interface RTCRtpSendParameters extends RTCRtpParameters { - degradationPreference?: RTCDegradationPreference; - encodings: RTCRtpEncodingParameters[]; - transactionId: string; -} - -interface RTCRtpStreamStats extends RTCStats { - codecId?: string; - kind: string; - ssrc: number; - transportId?: string; -} - -interface RTCRtpSynchronizationSource extends RTCRtpContributingSource { -} - -interface RTCRtpTransceiverInit { - direction?: RTCRtpTransceiverDirection; - sendEncodings?: RTCRtpEncodingParameters[]; - streams?: MediaStream[]; -} - -interface RTCSentRtpStreamStats extends RTCRtpStreamStats { - bytesSent?: number; - packetsSent?: number; -} - -interface RTCSessionDescriptionInit { - sdp?: string; - type: RTCSdpType; -} - -interface RTCStats { - id: string; - timestamp: DOMHighResTimeStamp; - type: RTCStatsType; -} - -interface RTCTrackEventInit extends EventInit { - receiver: RTCRtpReceiver; - streams?: MediaStream[]; - track: MediaStreamTrack; - transceiver: RTCRtpTransceiver; -} - -interface RTCTransportStats extends RTCStats { - bytesReceived?: number; - bytesSent?: number; - dtlsCipher?: string; - dtlsState: RTCDtlsTransportState; - localCertificateId?: string; - remoteCertificateId?: string; - rtcpTransportStatsId?: string; - selectedCandidatePairId?: string; - srtpCipher?: string; - tlsVersion?: string; -} - -interface ReadableStreamDefaultReadDoneResult { - done: true; - value?: undefined; -} - -interface ReadableStreamDefaultReadValueResult { - done: false; - value: T; -} - -interface ReadableWritablePair { - readable: ReadableStream; - /** - * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. - * - * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. - */ - writable: WritableStream; -} - -interface RegistrationOptions { - scope?: string; - type?: WorkerType; - updateViaCache?: ServiceWorkerUpdateViaCache; -} - -interface RequestInit { - /** A BodyInit object or null to set request's body. */ - body?: BodyInit | null; - /** A string indicating how the request will interact with the browser's cache to set request's cache. */ - cache?: RequestCache; - /** A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. */ - credentials?: RequestCredentials; - /** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ - headers?: HeadersInit; - /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ - integrity?: string; - /** A boolean to set request's keepalive. */ - keepalive?: boolean; - /** A string to set request's method. */ - method?: string; - /** A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. */ - mode?: RequestMode; - /** A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */ - redirect?: RequestRedirect; - /** A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. */ - referrer?: string; - /** A referrer policy to set request's referrerPolicy. */ - referrerPolicy?: ReferrerPolicy; - /** An AbortSignal to set request's signal. */ - signal?: AbortSignal | null; - /** Can only be null. Used to disassociate request from any Window. */ - window?: null; -} - -interface ResizeObserverOptions { - box?: ResizeObserverBoxOptions; -} - -interface ResponseInit { - headers?: HeadersInit; - status?: number; - statusText?: string; -} - -interface RsaHashedImportParams extends Algorithm { - hash: HashAlgorithmIdentifier; -} - -interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - hash: KeyAlgorithm; -} - -interface RsaHashedKeyGenParams extends RsaKeyGenParams { - hash: HashAlgorithmIdentifier; -} - -interface RsaKeyAlgorithm extends KeyAlgorithm { - modulusLength: number; - publicExponent: BigInteger; -} - -interface RsaKeyGenParams extends Algorithm { - modulusLength: number; - publicExponent: BigInteger; -} - -interface RsaOaepParams extends Algorithm { - label?: BufferSource; -} - -interface RsaOtherPrimesInfo { - d?: string; - r?: string; - t?: string; -} - -interface RsaPssParams extends Algorithm { - saltLength: number; -} - -interface SVGBoundingBoxOptions { - clipped?: boolean; - fill?: boolean; - markers?: boolean; - stroke?: boolean; -} - -interface ScrollIntoViewOptions extends ScrollOptions { - block?: ScrollLogicalPosition; - inline?: ScrollLogicalPosition; -} - -interface ScrollOptions { - behavior?: ScrollBehavior; -} - -interface ScrollToOptions extends ScrollOptions { - left?: number; - top?: number; -} - -interface SecurityPolicyViolationEventInit extends EventInit { - blockedURI?: string; - columnNumber?: number; - disposition: SecurityPolicyViolationEventDisposition; - documentURI: string; - effectiveDirective: string; - lineNumber?: number; - originalPolicy: string; - referrer?: string; - sample?: string; - sourceFile?: string; - statusCode: number; - violatedDirective: string; -} - -interface ShadowRootInit { - delegatesFocus?: boolean; - mode: ShadowRootMode; - slotAssignment?: SlotAssignmentMode; -} - -interface ShareData { - files?: File[]; - text?: string; - title?: string; - url?: string; -} - -interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit { - error: SpeechSynthesisErrorCode; -} - -interface SpeechSynthesisEventInit extends EventInit { - charIndex?: number; - charLength?: number; - elapsedTime?: number; - name?: string; - utterance: SpeechSynthesisUtterance; -} - -interface StaticRangeInit { - endContainer: Node; - endOffset: number; - startContainer: Node; - startOffset: number; -} - -interface StereoPannerOptions extends AudioNodeOptions { - pan?: number; -} - -interface StorageEstimate { - quota?: number; - usage?: number; -} - -interface StorageEventInit extends EventInit { - key?: string | null; - newValue?: string | null; - oldValue?: string | null; - storageArea?: Storage | null; - url?: string; -} - -interface StreamPipeOptions { - preventAbort?: boolean; - preventCancel?: boolean; - /** - * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - * - * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. - * - * Errors and closures of the source and destination streams propagate as follows: - * - * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. - * - * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. - * - * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - * - * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - * - * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. - */ - preventClose?: boolean; - signal?: AbortSignal; -} - -interface StructuredSerializeOptions { - transfer?: Transferable[]; -} - -interface SubmitEventInit extends EventInit { - submitter?: HTMLElement | null; -} - -interface TextDecodeOptions { - stream?: boolean; -} - -interface TextDecoderOptions { - fatal?: boolean; - ignoreBOM?: boolean; -} - -interface TextEncoderEncodeIntoResult { - read?: number; - written?: number; -} - -interface TouchEventInit extends EventModifierInit { - changedTouches?: Touch[]; - targetTouches?: Touch[]; - touches?: Touch[]; -} - -interface TouchInit { - altitudeAngle?: number; - azimuthAngle?: number; - clientX?: number; - clientY?: number; - force?: number; - identifier: number; - pageX?: number; - pageY?: number; - radiusX?: number; - radiusY?: number; - rotationAngle?: number; - screenX?: number; - screenY?: number; - target: EventTarget; - touchType?: TouchType; -} - -interface TrackEventInit extends EventInit { - track?: TextTrack | null; -} - -interface Transformer { - flush?: TransformerFlushCallback; - readableType?: undefined; - start?: TransformerStartCallback; - transform?: TransformerTransformCallback; - writableType?: undefined; -} - -interface TransitionEventInit extends EventInit { - elapsedTime?: number; - propertyName?: string; - pseudoElement?: string; -} - -interface UIEventInit extends EventInit { - detail?: number; - view?: Window | null; - /** @deprecated */ - which?: number; -} - -interface ULongRange { - max?: number; - min?: number; -} - -interface UnderlyingSink { - abort?: UnderlyingSinkAbortCallback; - close?: UnderlyingSinkCloseCallback; - start?: UnderlyingSinkStartCallback; - type?: undefined; - write?: UnderlyingSinkWriteCallback; -} - -interface UnderlyingSource { - cancel?: UnderlyingSourceCancelCallback; - pull?: UnderlyingSourcePullCallback; - start?: UnderlyingSourceStartCallback; - type?: undefined; -} - -interface VideoColorSpaceInit { - fullRange?: boolean; - matrix?: VideoMatrixCoefficients; - primaries?: VideoColorPrimaries; - transfer?: VideoTransferCharacteristics; -} - -interface VideoConfiguration { - bitrate: number; - colorGamut?: ColorGamut; - contentType: string; - framerate: number; - hdrMetadataType?: HdrMetadataType; - height: number; - scalabilityMode?: string; - transferFunction?: TransferFunction; - width: number; -} - -interface VideoFrameMetadata { - captureTime?: DOMHighResTimeStamp; - expectedDisplayTime: DOMHighResTimeStamp; - height: number; - mediaTime: number; - presentationTime: DOMHighResTimeStamp; - presentedFrames: number; - processingDuration?: number; - receiveTime?: DOMHighResTimeStamp; - rtpTimestamp?: number; - width: number; -} - -interface WaveShaperOptions extends AudioNodeOptions { - curve?: number[] | Float32Array; - oversample?: OverSampleType; -} - -interface WebGLContextAttributes { - alpha?: boolean; - antialias?: boolean; - depth?: boolean; - desynchronized?: boolean; - failIfMajorPerformanceCaveat?: boolean; - powerPreference?: WebGLPowerPreference; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; - stencil?: boolean; -} - -interface WebGLContextEventInit extends EventInit { - statusMessage?: string; -} - -interface WheelEventInit extends MouseEventInit { - deltaMode?: number; - deltaX?: number; - deltaY?: number; - deltaZ?: number; -} - -interface WindowPostMessageOptions extends StructuredSerializeOptions { - targetOrigin?: string; -} - -interface WorkerOptions { - credentials?: RequestCredentials; - name?: string; - type?: WorkerType; -} - -interface WorkletOptions { - credentials?: RequestCredentials; -} - -type NodeFilter = ((node: Node) => number) | { acceptNode(node: Node): number; }; - -declare var NodeFilter: { - readonly FILTER_ACCEPT: number; - readonly FILTER_REJECT: number; - readonly FILTER_SKIP: number; - readonly SHOW_ALL: number; - readonly SHOW_ATTRIBUTE: number; - readonly SHOW_CDATA_SECTION: number; - readonly SHOW_COMMENT: number; - readonly SHOW_DOCUMENT: number; - readonly SHOW_DOCUMENT_FRAGMENT: number; - readonly SHOW_DOCUMENT_TYPE: number; - readonly SHOW_ELEMENT: number; - readonly SHOW_ENTITY: number; - readonly SHOW_ENTITY_REFERENCE: number; - readonly SHOW_NOTATION: number; - readonly SHOW_PROCESSING_INSTRUCTION: number; - readonly SHOW_TEXT: number; -}; - -type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; }; - -/** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */ -interface ANGLE_instanced_arrays { - drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; - drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; - vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum; -} - -interface ARIAMixin { - ariaAtomic: string | null; - ariaAutoComplete: string | null; - ariaBusy: string | null; - ariaChecked: string | null; - ariaColCount: string | null; - ariaColIndex: string | null; - ariaColSpan: string | null; - ariaCurrent: string | null; - ariaDisabled: string | null; - ariaExpanded: string | null; - ariaHasPopup: string | null; - ariaHidden: string | null; - ariaKeyShortcuts: string | null; - ariaLabel: string | null; - ariaLevel: string | null; - ariaLive: string | null; - ariaModal: string | null; - ariaMultiLine: string | null; - ariaMultiSelectable: string | null; - ariaOrientation: string | null; - ariaPlaceholder: string | null; - ariaPosInSet: string | null; - ariaPressed: string | null; - ariaReadOnly: string | null; - ariaRequired: string | null; - ariaRoleDescription: string | null; - ariaRowCount: string | null; - ariaRowIndex: string | null; - ariaRowSpan: string | null; - ariaSelected: string | null; - ariaSetSize: string | null; - ariaSort: string | null; - ariaValueMax: string | null; - ariaValueMin: string | null; - ariaValueNow: string | null; - ariaValueText: string | null; -} - -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** Returns the AbortSignal object associated with this object. */ - readonly signal: AbortSignal; - /** Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ - abort(reason?: any): void; -} - -declare var AbortController: { - prototype: AbortController; - new(): AbortController; -}; - -interface AbortSignalEventMap { - "abort": Event; -} - -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal extends EventTarget { - /** Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ - readonly aborted: boolean; - onabort: ((this: AbortSignal, ev: Event) => any) | null; - readonly reason: any; - throwIfAborted(): void; - addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var AbortSignal: { - prototype: AbortSignal; - new(): AbortSignal; - // abort(): AbortSignal; - To be re-added in the future -}; - -interface AbstractRange { - /** Returns true if range is collapsed, and false otherwise. */ - readonly collapsed: boolean; - /** Returns range's end node. */ - readonly endContainer: Node; - /** Returns range's end offset. */ - readonly endOffset: number; - /** Returns range's start node. */ - readonly startContainer: Node; - /** Returns range's start offset. */ - readonly startOffset: number; -} - -declare var AbstractRange: { - prototype: AbstractRange; - new(): AbstractRange; -}; - -interface AbstractWorkerEventMap { - "error": ErrorEvent; -} - -interface AbstractWorker { - onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null; - addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -/** A node able to provide real-time frequency and time-domain analysis information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. */ -interface AnalyserNode extends AudioNode { - fftSize: number; - readonly frequencyBinCount: number; - maxDecibels: number; - minDecibels: number; - smoothingTimeConstant: number; - getByteFrequencyData(array: Uint8Array): void; - getByteTimeDomainData(array: Uint8Array): void; - getFloatFrequencyData(array: Float32Array): void; - getFloatTimeDomainData(array: Float32Array): void; -} - -declare var AnalyserNode: { - prototype: AnalyserNode; - new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode; -}; - -interface Animatable { - animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; - getAnimations(options?: GetAnimationsOptions): Animation[]; -} - -interface AnimationEventMap { - "cancel": AnimationPlaybackEvent; - "finish": AnimationPlaybackEvent; - "remove": Event; -} - -interface Animation extends EventTarget { - currentTime: CSSNumberish | null; - effect: AnimationEffect | null; - readonly finished: Promise; - id: string; - oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; - onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; - onremove: ((this: Animation, ev: Event) => any) | null; - readonly pending: boolean; - readonly playState: AnimationPlayState; - playbackRate: number; - readonly ready: Promise; - readonly replaceState: AnimationReplaceState; - startTime: CSSNumberish | null; - timeline: AnimationTimeline | null; - cancel(): void; - commitStyles(): void; - finish(): void; - pause(): void; - persist(): void; - play(): void; - reverse(): void; - updatePlaybackRate(playbackRate: number): void; - addEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var Animation: { - prototype: Animation; - new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; -}; - -interface AnimationEffect { - getComputedTiming(): ComputedEffectTiming; - getTiming(): EffectTiming; - updateTiming(timing?: OptionalEffectTiming): void; -} - -declare var AnimationEffect: { - prototype: AnimationEffect; - new(): AnimationEffect; -}; - -/** Events providing information related to animations. */ -interface AnimationEvent extends Event { - readonly animationName: string; - readonly elapsedTime: number; - readonly pseudoElement: string; -} - -declare var AnimationEvent: { - prototype: AnimationEvent; - new(type: string, animationEventInitDict?: AnimationEventInit): AnimationEvent; -}; - -interface AnimationFrameProvider { - cancelAnimationFrame(handle: number): void; - requestAnimationFrame(callback: FrameRequestCallback): number; -} - -interface AnimationPlaybackEvent extends Event { - readonly currentTime: CSSNumberish | null; - readonly timelineTime: CSSNumberish | null; -} - -declare var AnimationPlaybackEvent: { - prototype: AnimationPlaybackEvent; - new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; -}; - -interface AnimationTimeline { - readonly currentTime: number | null; -} - -declare var AnimationTimeline: { - prototype: AnimationTimeline; - new(): AnimationTimeline; -}; - -/** A DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types. */ -interface Attr extends Node { - readonly localName: string; - readonly name: string; - readonly namespaceURI: string | null; - readonly ownerDocument: Document; - readonly ownerElement: Element | null; - readonly prefix: string | null; - readonly specified: boolean; - value: string; -} - -declare var Attr: { - prototype: Attr; - new(): Attr; -}; - -/** A short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode. */ -interface AudioBuffer { - readonly duration: number; - readonly length: number; - readonly numberOfChannels: number; - readonly sampleRate: number; - copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void; - copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void; - getChannelData(channel: number): Float32Array; -} - -declare var AudioBuffer: { - prototype: AudioBuffer; - new(options: AudioBufferOptions): AudioBuffer; -}; - -/** An AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. */ -interface AudioBufferSourceNode extends AudioScheduledSourceNode { - buffer: AudioBuffer | null; - readonly detune: AudioParam; - loop: boolean; - loopEnd: number; - loopStart: number; - readonly playbackRate: AudioParam; - start(when?: number, offset?: number, duration?: number): void; - addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var AudioBufferSourceNode: { - prototype: AudioBufferSourceNode; - new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode; -}; - -/** An audio-processing graph built from audio modules linked together, each represented by an AudioNode. */ -interface AudioContext extends BaseAudioContext { - readonly baseLatency: number; - close(): Promise; - createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; - createMediaStreamDestination(): MediaStreamAudioDestinationNode; - createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; - getOutputTimestamp(): AudioTimestamp; - resume(): Promise; - suspend(): Promise; - addEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var AudioContext: { - prototype: AudioContext; - new(contextOptions?: AudioContextOptions): AudioContext; -}; - -/** AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between 0 and the maxChannelCount value or an exception is raised. */ -interface AudioDestinationNode extends AudioNode { - readonly maxChannelCount: number; -} - -declare var AudioDestinationNode: { - prototype: AudioDestinationNode; - new(): AudioDestinationNode; -}; - -/** The position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. */ -interface AudioListener { - readonly forwardX: AudioParam; - readonly forwardY: AudioParam; - readonly forwardZ: AudioParam; - readonly positionX: AudioParam; - readonly positionY: AudioParam; - readonly positionZ: AudioParam; - readonly upX: AudioParam; - readonly upY: AudioParam; - readonly upZ: AudioParam; - /** @deprecated */ - setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; - /** @deprecated */ - setPosition(x: number, y: number, z: number): void; -} - -declare var AudioListener: { - prototype: AudioListener; - new(): AudioListener; -}; - -/** A generic interface for representing an audio processing module. Examples include: */ -interface AudioNode extends EventTarget { - channelCount: number; - channelCountMode: ChannelCountMode; - channelInterpretation: ChannelInterpretation; - readonly context: BaseAudioContext; - readonly numberOfInputs: number; - readonly numberOfOutputs: number; - connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode; - connect(destinationParam: AudioParam, output?: number): void; - disconnect(): void; - disconnect(output: number): void; - disconnect(destinationNode: AudioNode): void; - disconnect(destinationNode: AudioNode, output: number): void; - disconnect(destinationNode: AudioNode, output: number, input: number): void; - disconnect(destinationParam: AudioParam): void; - disconnect(destinationParam: AudioParam, output: number): void; -} - -declare var AudioNode: { - prototype: AudioNode; - new(): AudioNode; -}; - -/** The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain). */ -interface AudioParam { - automationRate: AutomationRate; - readonly defaultValue: number; - readonly maxValue: number; - readonly minValue: number; - value: number; - cancelAndHoldAtTime(cancelTime: number): AudioParam; - cancelScheduledValues(cancelTime: number): AudioParam; - exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; - linearRampToValueAtTime(value: number, endTime: number): AudioParam; - setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; - setValueAtTime(value: number, startTime: number): AudioParam; - setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam; -} - -declare var AudioParam: { - prototype: AudioParam; - new(): AudioParam; -}; - -interface AudioParamMap { - forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void; -} - -declare var AudioParamMap: { - prototype: AudioParamMap; - new(): AudioParamMap; -}; - -/** - * The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed. - * @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet. - */ -interface AudioProcessingEvent extends Event { - /** @deprecated */ - readonly inputBuffer: AudioBuffer; - /** @deprecated */ - readonly outputBuffer: AudioBuffer; - /** @deprecated */ - readonly playbackTime: number; -} - -/** @deprecated */ -declare var AudioProcessingEvent: { - prototype: AudioProcessingEvent; - new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent; -}; - -interface AudioScheduledSourceNodeEventMap { - "ended": Event; -} - -interface AudioScheduledSourceNode extends AudioNode { - onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null; - start(when?: number): void; - stop(when?: number): void; - addEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var AudioScheduledSourceNode: { - prototype: AudioScheduledSourceNode; - new(): AudioScheduledSourceNode; -}; - -/** Available only in secure contexts. */ -interface AudioWorklet extends Worklet { -} - -declare var AudioWorklet: { - prototype: AudioWorklet; - new(): AudioWorklet; -}; - -interface AudioWorkletNodeEventMap { - "processorerror": Event; -} - -/** Available only in secure contexts. */ -interface AudioWorkletNode extends AudioNode { - onprocessorerror: ((this: AudioWorkletNode, ev: Event) => any) | null; - readonly parameters: AudioParamMap; - readonly port: MessagePort; - addEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var AudioWorkletNode: { - prototype: AudioWorkletNode; - new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode; -}; - -/** Available only in secure contexts. */ -interface AuthenticatorAssertionResponse extends AuthenticatorResponse { - readonly authenticatorData: ArrayBuffer; - readonly signature: ArrayBuffer; - readonly userHandle: ArrayBuffer | null; -} - -declare var AuthenticatorAssertionResponse: { - prototype: AuthenticatorAssertionResponse; - new(): AuthenticatorAssertionResponse; -}; - -/** Available only in secure contexts. */ -interface AuthenticatorAttestationResponse extends AuthenticatorResponse { - readonly attestationObject: ArrayBuffer; -} - -declare var AuthenticatorAttestationResponse: { - prototype: AuthenticatorAttestationResponse; - new(): AuthenticatorAttestationResponse; -}; - -/** Available only in secure contexts. */ -interface AuthenticatorResponse { - readonly clientDataJSON: ArrayBuffer; -} - -declare var AuthenticatorResponse: { - prototype: AuthenticatorResponse; - new(): AuthenticatorResponse; -}; - -interface BarProp { - readonly visible: boolean; -} - -declare var BarProp: { - prototype: BarProp; - new(): BarProp; -}; - -interface BaseAudioContextEventMap { - "statechange": Event; -} - -interface BaseAudioContext extends EventTarget { - /** Available only in secure contexts. */ - readonly audioWorklet: AudioWorklet; - readonly currentTime: number; - readonly destination: AudioDestinationNode; - readonly listener: AudioListener; - onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null; - readonly sampleRate: number; - readonly state: AudioContextState; - createAnalyser(): AnalyserNode; - createBiquadFilter(): BiquadFilterNode; - createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; - createBufferSource(): AudioBufferSourceNode; - createChannelMerger(numberOfInputs?: number): ChannelMergerNode; - createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; - createConstantSource(): ConstantSourceNode; - createConvolver(): ConvolverNode; - createDelay(maxDelayTime?: number): DelayNode; - createDynamicsCompressor(): DynamicsCompressorNode; - createGain(): GainNode; - createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; - createOscillator(): OscillatorNode; - createPanner(): PannerNode; - createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; - /** @deprecated */ - createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; - createStereoPanner(): StereoPannerNode; - createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; - addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var BaseAudioContext: { - prototype: BaseAudioContext; - new(): BaseAudioContext; -}; - -/** The beforeunload event is fired when the window, the document and its resources are about to be unloaded. */ -interface BeforeUnloadEvent extends Event { - returnValue: any; -} - -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -}; - -/** A simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. */ -interface BiquadFilterNode extends AudioNode { - readonly Q: AudioParam; - readonly detune: AudioParam; - readonly frequency: AudioParam; - readonly gain: AudioParam; - type: BiquadFilterType; - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; -} - -declare var BiquadFilterNode: { - prototype: BiquadFilterNode; - new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode; -}; - -/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */ -interface Blob { - readonly size: number; - readonly type: string; - arrayBuffer(): Promise; - slice(start?: number, end?: number, contentType?: string): Blob; - stream(): ReadableStream; - text(): Promise; -} - -declare var Blob: { - prototype: Blob; - new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; -}; - -interface BlobEvent extends Event { - readonly data: Blob; - readonly timecode: DOMHighResTimeStamp; -} - -declare var BlobEvent: { - prototype: BlobEvent; - new(type: string, eventInitDict: BlobEventInit): BlobEvent; -}; - -interface Body { - readonly body: ReadableStream | null; - readonly bodyUsed: boolean; - arrayBuffer(): Promise; - blob(): Promise; - formData(): Promise; - json(): Promise; - text(): Promise; -} - -interface BroadcastChannelEventMap { - "message": MessageEvent; - "messageerror": MessageEvent; -} - -interface BroadcastChannel extends EventTarget { - /** Returns the channel name (as passed to the constructor). */ - readonly name: string; - onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; - onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; - /** Closes the BroadcastChannel object, opening it up to garbage collection. */ - close(): void; - /** Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays. */ - postMessage(message: any): void; - addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var BroadcastChannel: { - prototype: BroadcastChannel; - new(name: string): BroadcastChannel; -}; - -/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ -interface ByteLengthQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; -} - -declare var ByteLengthQueuingStrategy: { - prototype: ByteLengthQueuingStrategy; - new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; -}; - -/** A CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & don’t need escaping as they normally do when inside a CDATA section. */ -interface CDATASection extends Text { -} - -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -}; - -interface CSSAnimation extends Animation { - readonly animationName: string; - addEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var CSSAnimation: { - prototype: CSSAnimation; - new(): CSSAnimation; -}; - -/** A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */ -interface CSSConditionRule extends CSSGroupingRule { - conditionText: string; -} - -declare var CSSConditionRule: { - prototype: CSSConditionRule; - new(): CSSConditionRule; -}; - -interface CSSCounterStyleRule extends CSSRule { - additiveSymbols: string; - fallback: string; - name: string; - negative: string; - pad: string; - prefix: string; - range: string; - speakAs: string; - suffix: string; - symbols: string; - system: string; -} - -declare var CSSCounterStyleRule: { - prototype: CSSCounterStyleRule; - new(): CSSCounterStyleRule; -}; - -interface CSSFontFaceRule extends CSSRule { - readonly style: CSSStyleDeclaration; -} - -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -}; - -/** Any CSS at-rule that contains other rules nested within it. */ -interface CSSGroupingRule extends CSSRule { - readonly cssRules: CSSRuleList; - deleteRule(index: number): void; - insertRule(rule: string, index?: number): number; -} - -declare var CSSGroupingRule: { - prototype: CSSGroupingRule; - new(): CSSGroupingRule; -}; - -interface CSSImportRule extends CSSRule { - readonly href: string; - readonly media: MediaList; - readonly styleSheet: CSSStyleSheet; -} - -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -}; - -/** An object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a @keyframes at-rule. It implements the CSSRule interface with a type value of 8 (CSSRule.KEYFRAME_RULE). */ -interface CSSKeyframeRule extends CSSRule { - keyText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -}; - -/** An object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE). */ -interface CSSKeyframesRule extends CSSRule { - readonly cssRules: CSSRuleList; - name: string; - appendRule(rule: string): void; - deleteRule(select: string): void; - findRule(select: string): CSSKeyframeRule | null; -} - -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -}; - -/** A single CSS @media rule. It implements the CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE). */ -interface CSSMediaRule extends CSSConditionRule { - readonly media: MediaList; -} - -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -}; - -/** An object representing a single CSS @namespace at-rule. It implements the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). */ -interface CSSNamespaceRule extends CSSRule { - readonly namespaceURI: string; - readonly prefix: string; -} - -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -}; - -/** CSSPageRule is an interface representing a single CSS @page rule. It implements the CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). */ -interface CSSPageRule extends CSSGroupingRule { - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -}; - -/** A single CSS rule. There are several types of rules, listed in the Type constants section below. */ -interface CSSRule { - cssText: string; - readonly parentRule: CSSRule | null; - readonly parentStyleSheet: CSSStyleSheet | null; - /** @deprecated */ - readonly type: number; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; -} - -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - readonly CHARSET_RULE: number; - readonly FONT_FACE_RULE: number; - readonly IMPORT_RULE: number; - readonly KEYFRAMES_RULE: number; - readonly KEYFRAME_RULE: number; - readonly MEDIA_RULE: number; - readonly NAMESPACE_RULE: number; - readonly PAGE_RULE: number; - readonly STYLE_RULE: number; - readonly SUPPORTS_RULE: number; -}; - -/** A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. */ -interface CSSRuleList { - readonly length: number; - item(index: number): CSSRule | null; - [index: number]: CSSRule; -} - -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -}; - -/** An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. */ -interface CSSStyleDeclaration { - accentColor: string; - alignContent: string; - alignItems: string; - alignSelf: string; - alignmentBaseline: string; - all: string; - animation: string; - animationDelay: string; - animationDirection: string; - animationDuration: string; - animationFillMode: string; - animationIterationCount: string; - animationName: string; - animationPlayState: string; - animationTimingFunction: string; - appearance: string; - aspectRatio: string; - backfaceVisibility: string; - background: string; - backgroundAttachment: string; - backgroundBlendMode: string; - backgroundClip: string; - backgroundColor: string; - backgroundImage: string; - backgroundOrigin: string; - backgroundPosition: string; - backgroundPositionX: string; - backgroundPositionY: string; - backgroundRepeat: string; - backgroundSize: string; - baselineShift: string; - blockSize: string; - border: string; - borderBlock: string; - borderBlockColor: string; - borderBlockEnd: string; - borderBlockEndColor: string; - borderBlockEndStyle: string; - borderBlockEndWidth: string; - borderBlockStart: string; - borderBlockStartColor: string; - borderBlockStartStyle: string; - borderBlockStartWidth: string; - borderBlockStyle: string; - borderBlockWidth: string; - borderBottom: string; - borderBottomColor: string; - borderBottomLeftRadius: string; - borderBottomRightRadius: string; - borderBottomStyle: string; - borderBottomWidth: string; - borderCollapse: string; - borderColor: string; - borderEndEndRadius: string; - borderEndStartRadius: string; - borderImage: string; - borderImageOutset: string; - borderImageRepeat: string; - borderImageSlice: string; - borderImageSource: string; - borderImageWidth: string; - borderInline: string; - borderInlineColor: string; - borderInlineEnd: string; - borderInlineEndColor: string; - borderInlineEndStyle: string; - borderInlineEndWidth: string; - borderInlineStart: string; - borderInlineStartColor: string; - borderInlineStartStyle: string; - borderInlineStartWidth: string; - borderInlineStyle: string; - borderInlineWidth: string; - borderLeft: string; - borderLeftColor: string; - borderLeftStyle: string; - borderLeftWidth: string; - borderRadius: string; - borderRight: string; - borderRightColor: string; - borderRightStyle: string; - borderRightWidth: string; - borderSpacing: string; - borderStartEndRadius: string; - borderStartStartRadius: string; - borderStyle: string; - borderTop: string; - borderTopColor: string; - borderTopLeftRadius: string; - borderTopRightRadius: string; - borderTopStyle: string; - borderTopWidth: string; - borderWidth: string; - bottom: string; - boxShadow: string; - boxSizing: string; - breakAfter: string; - breakBefore: string; - breakInside: string; - captionSide: string; - caretColor: string; - clear: string; - /** @deprecated */ - clip: string; - clipPath: string; - clipRule: string; - color: string; - colorInterpolation: string; - colorInterpolationFilters: string; - colorScheme: string; - columnCount: string; - columnFill: string; - columnGap: string; - columnRule: string; - columnRuleColor: string; - columnRuleStyle: string; - columnRuleWidth: string; - columnSpan: string; - columnWidth: string; - columns: string; - contain: string; - content: string; - contentVisibility: string; - counterIncrement: string; - counterReset: string; - counterSet: string; - cssFloat: string; - cssText: string; - cursor: string; - direction: string; - display: string; - dominantBaseline: string; - emptyCells: string; - fill: string; - fillOpacity: string; - fillRule: string; - filter: string; - flex: string; - flexBasis: string; - flexDirection: string; - flexFlow: string; - flexGrow: string; - flexShrink: string; - flexWrap: string; - float: string; - floodColor: string; - floodOpacity: string; - font: string; - fontFamily: string; - fontFeatureSettings: string; - fontKerning: string; - fontOpticalSizing: string; - fontSize: string; - fontSizeAdjust: string; - fontStretch: string; - fontStyle: string; - fontSynthesis: string; - fontVariant: string; - fontVariantAlternates: string; - fontVariantCaps: string; - fontVariantEastAsian: string; - fontVariantLigatures: string; - fontVariantNumeric: string; - fontVariantPosition: string; - fontVariationSettings: string; - fontWeight: string; - gap: string; - grid: string; - gridArea: string; - gridAutoColumns: string; - gridAutoFlow: string; - gridAutoRows: string; - gridColumn: string; - gridColumnEnd: string; - /** @deprecated This is a legacy alias of `columnGap`. */ - gridColumnGap: string; - gridColumnStart: string; - /** @deprecated This is a legacy alias of `gap`. */ - gridGap: string; - gridRow: string; - gridRowEnd: string; - /** @deprecated This is a legacy alias of `rowGap`. */ - gridRowGap: string; - gridRowStart: string; - gridTemplate: string; - gridTemplateAreas: string; - gridTemplateColumns: string; - gridTemplateRows: string; - height: string; - hyphens: string; - /** @deprecated */ - imageOrientation: string; - imageRendering: string; - inlineSize: string; - inset: string; - insetBlock: string; - insetBlockEnd: string; - insetBlockStart: string; - insetInline: string; - insetInlineEnd: string; - insetInlineStart: string; - isolation: string; - justifyContent: string; - justifyItems: string; - justifySelf: string; - left: string; - readonly length: number; - letterSpacing: string; - lightingColor: string; - lineBreak: string; - lineHeight: string; - listStyle: string; - listStyleImage: string; - listStylePosition: string; - listStyleType: string; - margin: string; - marginBlock: string; - marginBlockEnd: string; - marginBlockStart: string; - marginBottom: string; - marginInline: string; - marginInlineEnd: string; - marginInlineStart: string; - marginLeft: string; - marginRight: string; - marginTop: string; - marker: string; - markerEnd: string; - markerMid: string; - markerStart: string; - mask: string; - maskClip: string; - maskComposite: string; - maskImage: string; - maskMode: string; - maskOrigin: string; - maskPosition: string; - maskRepeat: string; - maskSize: string; - maskType: string; - maxBlockSize: string; - maxHeight: string; - maxInlineSize: string; - maxWidth: string; - minBlockSize: string; - minHeight: string; - minInlineSize: string; - minWidth: string; - mixBlendMode: string; - objectFit: string; - objectPosition: string; - offset: string; - offsetDistance: string; - offsetPath: string; - offsetRotate: string; - opacity: string; - order: string; - orphans: string; - outline: string; - outlineColor: string; - outlineOffset: string; - outlineStyle: string; - outlineWidth: string; - overflow: string; - overflowAnchor: string; - overflowWrap: string; - overflowX: string; - overflowY: string; - overscrollBehavior: string; - overscrollBehaviorBlock: string; - overscrollBehaviorInline: string; - overscrollBehaviorX: string; - overscrollBehaviorY: string; - padding: string; - paddingBlock: string; - paddingBlockEnd: string; - paddingBlockStart: string; - paddingBottom: string; - paddingInline: string; - paddingInlineEnd: string; - paddingInlineStart: string; - paddingLeft: string; - paddingRight: string; - paddingTop: string; - pageBreakAfter: string; - pageBreakBefore: string; - pageBreakInside: string; - paintOrder: string; - readonly parentRule: CSSRule | null; - perspective: string; - perspectiveOrigin: string; - placeContent: string; - placeItems: string; - placeSelf: string; - pointerEvents: string; - position: string; - printColorAdjust: string; - quotes: string; - resize: string; - right: string; - rotate: string; - rowGap: string; - rubyPosition: string; - scale: string; - scrollBehavior: string; - scrollMargin: string; - scrollMarginBlock: string; - scrollMarginBlockEnd: string; - scrollMarginBlockStart: string; - scrollMarginBottom: string; - scrollMarginInline: string; - scrollMarginInlineEnd: string; - scrollMarginInlineStart: string; - scrollMarginLeft: string; - scrollMarginRight: string; - scrollMarginTop: string; - scrollPadding: string; - scrollPaddingBlock: string; - scrollPaddingBlockEnd: string; - scrollPaddingBlockStart: string; - scrollPaddingBottom: string; - scrollPaddingInline: string; - scrollPaddingInlineEnd: string; - scrollPaddingInlineStart: string; - scrollPaddingLeft: string; - scrollPaddingRight: string; - scrollPaddingTop: string; - scrollSnapAlign: string; - scrollSnapStop: string; - scrollSnapType: string; - scrollbarGutter: string; - shapeImageThreshold: string; - shapeMargin: string; - shapeOutside: string; - shapeRendering: string; - stopColor: string; - stopOpacity: string; - stroke: string; - strokeDasharray: string; - strokeDashoffset: string; - strokeLinecap: string; - strokeLinejoin: string; - strokeMiterlimit: string; - strokeOpacity: string; - strokeWidth: string; - tabSize: string; - tableLayout: string; - textAlign: string; - textAlignLast: string; - textAnchor: string; - textCombineUpright: string; - textDecoration: string; - textDecorationColor: string; - textDecorationLine: string; - textDecorationSkipInk: string; - textDecorationStyle: string; - textDecorationThickness: string; - textEmphasis: string; - textEmphasisColor: string; - textEmphasisPosition: string; - textEmphasisStyle: string; - textIndent: string; - textOrientation: string; - textOverflow: string; - textRendering: string; - textShadow: string; - textTransform: string; - textUnderlineOffset: string; - textUnderlinePosition: string; - top: string; - touchAction: string; - transform: string; - transformBox: string; - transformOrigin: string; - transformStyle: string; - transition: string; - transitionDelay: string; - transitionDuration: string; - transitionProperty: string; - transitionTimingFunction: string; - translate: string; - unicodeBidi: string; - userSelect: string; - verticalAlign: string; - visibility: string; - /** @deprecated This is a legacy alias of `alignContent`. */ - webkitAlignContent: string; - /** @deprecated This is a legacy alias of `alignItems`. */ - webkitAlignItems: string; - /** @deprecated This is a legacy alias of `alignSelf`. */ - webkitAlignSelf: string; - /** @deprecated This is a legacy alias of `animation`. */ - webkitAnimation: string; - /** @deprecated This is a legacy alias of `animationDelay`. */ - webkitAnimationDelay: string; - /** @deprecated This is a legacy alias of `animationDirection`. */ - webkitAnimationDirection: string; - /** @deprecated This is a legacy alias of `animationDuration`. */ - webkitAnimationDuration: string; - /** @deprecated This is a legacy alias of `animationFillMode`. */ - webkitAnimationFillMode: string; - /** @deprecated This is a legacy alias of `animationIterationCount`. */ - webkitAnimationIterationCount: string; - /** @deprecated This is a legacy alias of `animationName`. */ - webkitAnimationName: string; - /** @deprecated This is a legacy alias of `animationPlayState`. */ - webkitAnimationPlayState: string; - /** @deprecated This is a legacy alias of `animationTimingFunction`. */ - webkitAnimationTimingFunction: string; - /** @deprecated This is a legacy alias of `appearance`. */ - webkitAppearance: string; - /** @deprecated This is a legacy alias of `backfaceVisibility`. */ - webkitBackfaceVisibility: string; - /** @deprecated This is a legacy alias of `backgroundClip`. */ - webkitBackgroundClip: string; - /** @deprecated This is a legacy alias of `backgroundOrigin`. */ - webkitBackgroundOrigin: string; - /** @deprecated This is a legacy alias of `backgroundSize`. */ - webkitBackgroundSize: string; - /** @deprecated This is a legacy alias of `borderBottomLeftRadius`. */ - webkitBorderBottomLeftRadius: string; - /** @deprecated This is a legacy alias of `borderBottomRightRadius`. */ - webkitBorderBottomRightRadius: string; - /** @deprecated This is a legacy alias of `borderRadius`. */ - webkitBorderRadius: string; - /** @deprecated This is a legacy alias of `borderTopLeftRadius`. */ - webkitBorderTopLeftRadius: string; - /** @deprecated This is a legacy alias of `borderTopRightRadius`. */ - webkitBorderTopRightRadius: string; - /** @deprecated This is a legacy alias of `boxAlign`. */ - webkitBoxAlign: string; - /** @deprecated This is a legacy alias of `boxFlex`. */ - webkitBoxFlex: string; - /** @deprecated This is a legacy alias of `boxOrdinalGroup`. */ - webkitBoxOrdinalGroup: string; - /** @deprecated This is a legacy alias of `boxOrient`. */ - webkitBoxOrient: string; - /** @deprecated This is a legacy alias of `boxPack`. */ - webkitBoxPack: string; - /** @deprecated This is a legacy alias of `boxShadow`. */ - webkitBoxShadow: string; - /** @deprecated This is a legacy alias of `boxSizing`. */ - webkitBoxSizing: string; - /** @deprecated This is a legacy alias of `filter`. */ - webkitFilter: string; - /** @deprecated This is a legacy alias of `flex`. */ - webkitFlex: string; - /** @deprecated This is a legacy alias of `flexBasis`. */ - webkitFlexBasis: string; - /** @deprecated This is a legacy alias of `flexDirection`. */ - webkitFlexDirection: string; - /** @deprecated This is a legacy alias of `flexFlow`. */ - webkitFlexFlow: string; - /** @deprecated This is a legacy alias of `flexGrow`. */ - webkitFlexGrow: string; - /** @deprecated This is a legacy alias of `flexShrink`. */ - webkitFlexShrink: string; - /** @deprecated This is a legacy alias of `flexWrap`. */ - webkitFlexWrap: string; - /** @deprecated This is a legacy alias of `justifyContent`. */ - webkitJustifyContent: string; - webkitLineClamp: string; - /** @deprecated This is a legacy alias of `mask`. */ - webkitMask: string; - /** @deprecated This is a legacy alias of `maskBorder`. */ - webkitMaskBoxImage: string; - /** @deprecated This is a legacy alias of `maskBorderOutset`. */ - webkitMaskBoxImageOutset: string; - /** @deprecated This is a legacy alias of `maskBorderRepeat`. */ - webkitMaskBoxImageRepeat: string; - /** @deprecated This is a legacy alias of `maskBorderSlice`. */ - webkitMaskBoxImageSlice: string; - /** @deprecated This is a legacy alias of `maskBorderSource`. */ - webkitMaskBoxImageSource: string; - /** @deprecated This is a legacy alias of `maskBorderWidth`. */ - webkitMaskBoxImageWidth: string; - /** @deprecated This is a legacy alias of `maskClip`. */ - webkitMaskClip: string; - webkitMaskComposite: string; - /** @deprecated This is a legacy alias of `maskImage`. */ - webkitMaskImage: string; - /** @deprecated This is a legacy alias of `maskOrigin`. */ - webkitMaskOrigin: string; - /** @deprecated This is a legacy alias of `maskPosition`. */ - webkitMaskPosition: string; - /** @deprecated This is a legacy alias of `maskRepeat`. */ - webkitMaskRepeat: string; - /** @deprecated This is a legacy alias of `maskSize`. */ - webkitMaskSize: string; - /** @deprecated This is a legacy alias of `order`. */ - webkitOrder: string; - /** @deprecated This is a legacy alias of `perspective`. */ - webkitPerspective: string; - /** @deprecated This is a legacy alias of `perspectiveOrigin`. */ - webkitPerspectiveOrigin: string; - webkitTextFillColor: string; - webkitTextStroke: string; - webkitTextStrokeColor: string; - webkitTextStrokeWidth: string; - /** @deprecated This is a legacy alias of `transform`. */ - webkitTransform: string; - /** @deprecated This is a legacy alias of `transformOrigin`. */ - webkitTransformOrigin: string; - /** @deprecated This is a legacy alias of `transformStyle`. */ - webkitTransformStyle: string; - /** @deprecated This is a legacy alias of `transition`. */ - webkitTransition: string; - /** @deprecated This is a legacy alias of `transitionDelay`. */ - webkitTransitionDelay: string; - /** @deprecated This is a legacy alias of `transitionDuration`. */ - webkitTransitionDuration: string; - /** @deprecated This is a legacy alias of `transitionProperty`. */ - webkitTransitionProperty: string; - /** @deprecated This is a legacy alias of `transitionTimingFunction`. */ - webkitTransitionTimingFunction: string; - /** @deprecated This is a legacy alias of `userSelect`. */ - webkitUserSelect: string; - whiteSpace: string; - widows: string; - width: string; - willChange: string; - wordBreak: string; - wordSpacing: string; - /** @deprecated */ - wordWrap: string; - writingMode: string; - zIndex: string; - getPropertyPriority(property: string): string; - getPropertyValue(property: string): string; - item(index: number): string; - removeProperty(property: string): string; - setProperty(property: string, value: string | null, priority?: string): void; - [index: number]: string; -} - -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -}; - -/** CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE). */ -interface CSSStyleRule extends CSSRule { - selectorText: string; - readonly style: CSSStyleDeclaration; -} - -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -}; - -/** A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet. */ -interface CSSStyleSheet extends StyleSheet { - readonly cssRules: CSSRuleList; - readonly ownerRule: CSSRule | null; - /** @deprecated */ - readonly rules: CSSRuleList; - /** @deprecated */ - addRule(selector?: string, style?: string, index?: number): number; - deleteRule(index: number): void; - insertRule(rule: string, index?: number): number; - /** @deprecated */ - removeRule(index?: number): void; -} - -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(options?: CSSStyleSheetInit): CSSStyleSheet; -}; - -/** An object representing a single CSS @supports at-rule. It implements the CSSConditionRule interface, and therefore the CSSRule and CSSGroupingRule interfaces with a type value of 12 (CSSRule.SUPPORTS_RULE). */ -interface CSSSupportsRule extends CSSConditionRule { -} - -declare var CSSSupportsRule: { - prototype: CSSSupportsRule; - new(): CSSSupportsRule; -}; - -interface CSSTransition extends Animation { - readonly transitionProperty: string; - addEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var CSSTransition: { - prototype: CSSTransition; - new(): CSSTransition; -}; - -/** - * Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. - * Available only in secure contexts. - */ -interface Cache { - add(request: RequestInfo | URL): Promise; - addAll(requests: RequestInfo[]): Promise; - delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; - keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; - match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; - matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; - put(request: RequestInfo | URL, response: Response): Promise; -} - -declare var Cache: { - prototype: Cache; - new(): Cache; -}; - -/** - * The storage for Cache objects. - * Available only in secure contexts. - */ -interface CacheStorage { - delete(cacheName: string): Promise; - has(cacheName: string): Promise; - keys(): Promise; - match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise; - open(cacheName: string): Promise; -} - -declare var CacheStorage: { - prototype: CacheStorage; - new(): CacheStorage; -}; - -interface CanvasCaptureMediaStreamTrack extends MediaStreamTrack { - readonly canvas: HTMLCanvasElement; - requestFrame(): void; - addEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var CanvasCaptureMediaStreamTrack: { - prototype: CanvasCaptureMediaStreamTrack; - new(): CanvasCaptureMediaStreamTrack; -}; - -interface CanvasCompositing { - globalAlpha: number; - globalCompositeOperation: GlobalCompositeOperation; -} - -interface CanvasDrawImage { - drawImage(image: CanvasImageSource, dx: number, dy: number): void; - drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void; - drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; -} - -interface CanvasDrawPath { - beginPath(): void; - clip(fillRule?: CanvasFillRule): void; - clip(path: Path2D, fillRule?: CanvasFillRule): void; - fill(fillRule?: CanvasFillRule): void; - fill(path: Path2D, fillRule?: CanvasFillRule): void; - isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; - isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; - isPointInStroke(x: number, y: number): boolean; - isPointInStroke(path: Path2D, x: number, y: number): boolean; - stroke(): void; - stroke(path: Path2D): void; -} - -interface CanvasFillStrokeStyles { - fillStyle: string | CanvasGradient | CanvasPattern; - strokeStyle: string | CanvasGradient | CanvasPattern; - createConicGradient(startAngle: number, x: number, y: number): CanvasGradient; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; -} - -interface CanvasFilters { - filter: string; -} - -/** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */ -interface CanvasGradient { - /** - * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. - * - * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed. - */ - addColorStop(offset: number, color: string): void; -} - -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -}; - -interface CanvasImageData { - createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData; - createImageData(imagedata: ImageData): ImageData; - getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData; - putImageData(imagedata: ImageData, dx: number, dy: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void; -} - -interface CanvasImageSmoothing { - imageSmoothingEnabled: boolean; - imageSmoothingQuality: ImageSmoothingQuality; -} - -interface CanvasPath { - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - closePath(): void; - ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; - lineTo(x: number, y: number): void; - moveTo(x: number, y: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; -} - -interface CanvasPathDrawingStyles { - lineCap: CanvasLineCap; - lineDashOffset: number; - lineJoin: CanvasLineJoin; - lineWidth: number; - miterLimit: number; - getLineDash(): number[]; - setLineDash(segments: number[]): void; -} - -/** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */ -interface CanvasPattern { - /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */ - setTransform(transform?: DOMMatrix2DInit): void; -} - -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -}; - -interface CanvasRect { - clearRect(x: number, y: number, w: number, h: number): void; - fillRect(x: number, y: number, w: number, h: number): void; - strokeRect(x: number, y: number, w: number, h: number): void; -} - -/** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a element. It is used for drawing shapes, text, images, and other objects. */ -interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface { - readonly canvas: HTMLCanvasElement; - getContextAttributes(): CanvasRenderingContext2DSettings; -} - -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -}; - -interface CanvasShadowStyles { - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; -} - -interface CanvasState { - restore(): void; - save(): void; -} - -interface CanvasText { - fillText(text: string, x: number, y: number, maxWidth?: number): void; - measureText(text: string): TextMetrics; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; -} - -interface CanvasTextDrawingStyles { - direction: CanvasDirection; - font: string; - textAlign: CanvasTextAlign; - textBaseline: CanvasTextBaseline; -} - -interface CanvasTransform { - getTransform(): DOMMatrix; - resetTransform(): void; - rotate(angle: number): void; - scale(x: number, y: number): void; - setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; - setTransform(transform?: DOMMatrix2DInit): void; - transform(a: number, b: number, c: number, d: number, e: number, f: number): void; - translate(x: number, y: number): void; -} - -interface CanvasUserInterface { - drawFocusIfNeeded(element: Element): void; - drawFocusIfNeeded(path: Path2D, element: Element): void; -} - -/** The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */ -interface ChannelMergerNode extends AudioNode { -} - -declare var ChannelMergerNode: { - prototype: ChannelMergerNode; - new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode; -}; - -/** The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */ -interface ChannelSplitterNode extends AudioNode { -} - -declare var ChannelSplitterNode: { - prototype: ChannelSplitterNode; - new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode; -}; - -/** The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't abstract. */ -interface CharacterData extends Node, ChildNode, NonDocumentTypeChildNode { - data: string; - readonly length: number; - readonly ownerDocument: Document; - appendData(data: string): void; - deleteData(offset: number, count: number): void; - insertData(offset: number, data: string): void; - replaceData(offset: number, count: number, data: string): void; - substringData(offset: number, count: number): string; -} - -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -}; - -interface ChildNode extends Node { - /** - * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. - * - * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. - */ - after(...nodes: (Node | string)[]): void; - /** - * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. - * - * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. - */ - before(...nodes: (Node | string)[]): void; - /** Removes node. */ - remove(): void; - /** - * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. - * - * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. - */ - replaceWith(...nodes: (Node | string)[]): void; -} - -/** @deprecated */ -interface ClientRect extends DOMRect { -} - -/** Available only in secure contexts. */ -interface Clipboard extends EventTarget { - read(): Promise; - readText(): Promise; - write(data: ClipboardItems): Promise; - writeText(data: string): Promise; -} - -declare var Clipboard: { - prototype: Clipboard; - new(): Clipboard; -}; - -/** Events providing information related to modification of the clipboard, that is cut, copy, and paste events. */ -interface ClipboardEvent extends Event { - readonly clipboardData: DataTransfer | null; -} - -declare var ClipboardEvent: { - prototype: ClipboardEvent; - new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; -}; - -/** Available only in secure contexts. */ -interface ClipboardItem { - readonly types: ReadonlyArray; - getType(type: string): Promise; -} - -declare var ClipboardItem: { - prototype: ClipboardItem; - new(items: Record>, options?: ClipboardItemOptions): ClipboardItem; -}; - -/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */ -interface CloseEvent extends Event { - /** Returns the WebSocket connection close code provided by the server. */ - readonly code: number; - /** Returns the WebSocket connection close reason provided by the server. */ - readonly reason: string; - /** Returns true if the connection closed cleanly; false otherwise. */ - readonly wasClean: boolean; -} - -declare var CloseEvent: { - prototype: CloseEvent; - new(type: string, eventInitDict?: CloseEventInit): CloseEvent; -}; - -/** Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. */ -interface Comment extends CharacterData { -} - -declare var Comment: { - prototype: Comment; - new(data?: string): Comment; -}; - -/** The DOM CompositionEvent represents events that occur due to the user indirectly entering text. */ -interface CompositionEvent extends UIEvent { - readonly data: string; - /** @deprecated */ - initCompositionEvent(typeArg: string, bubblesArg?: boolean, cancelableArg?: boolean, viewArg?: WindowProxy | null, dataArg?: string): void; -} - -declare var CompositionEvent: { - prototype: CompositionEvent; - new(type: string, eventInitDict?: CompositionEventInit): CompositionEvent; -}; - -interface ConstantSourceNode extends AudioScheduledSourceNode { - readonly offset: AudioParam; - addEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var ConstantSourceNode: { - prototype: ConstantSourceNode; - new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode; -}; - -/** An AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output. */ -interface ConvolverNode extends AudioNode { - buffer: AudioBuffer | null; - normalize: boolean; -} - -declare var ConvolverNode: { - prototype: ConvolverNode; - new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode; -}; - -/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ -interface CountQueuingStrategy extends QueuingStrategy { - readonly highWaterMark: number; - readonly size: QueuingStrategySize; -} - -declare var CountQueuingStrategy: { - prototype: CountQueuingStrategy; - new(init: QueuingStrategyInit): CountQueuingStrategy; -}; - -/** Available only in secure contexts. */ -interface Credential { - readonly id: string; - readonly type: string; -} - -declare var Credential: { - prototype: Credential; - new(): Credential; -}; - -/** Available only in secure contexts. */ -interface CredentialsContainer { - create(options?: CredentialCreationOptions): Promise; - get(options?: CredentialRequestOptions): Promise; - preventSilentAccess(): Promise; - store(credential: Credential): Promise; -} - -declare var CredentialsContainer: { - prototype: CredentialsContainer; - new(): CredentialsContainer; -}; - -/** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */ -interface Crypto { - /** Available only in secure contexts. */ - readonly subtle: SubtleCrypto; - getRandomValues(array: T): T; - /** Available only in secure contexts. */ - randomUUID(): string; -} - -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -}; - -/** - * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. - * Available only in secure contexts. - */ -interface CryptoKey { - readonly algorithm: KeyAlgorithm; - readonly extractable: boolean; - readonly type: KeyType; - readonly usages: KeyUsage[]; -} - -declare var CryptoKey: { - prototype: CryptoKey; - new(): CryptoKey; -}; - -interface CustomElementRegistry { - define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void; - get(name: string): CustomElementConstructor | undefined; - upgrade(root: Node): void; - whenDefined(name: string): Promise; -} - -declare var CustomElementRegistry: { - prototype: CustomElementRegistry; - new(): CustomElementRegistry; -}; - -interface CustomEvent extends Event { - /** Returns any custom data event was created with. Typically used for synthetic events. */ - readonly detail: T; - /** @deprecated */ - initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void; -} - -declare var CustomEvent: { - prototype: CustomEvent; - new(type: string, eventInitDict?: CustomEventInit): CustomEvent; -}; - -/** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */ -interface DOMException extends Error { - readonly code: number; - readonly message: string; - readonly name: string; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -} - -declare var DOMException: { - prototype: DOMException; - new(message?: string, name?: string): DOMException; - readonly ABORT_ERR: number; - readonly DATA_CLONE_ERR: number; - readonly DOMSTRING_SIZE_ERR: number; - readonly HIERARCHY_REQUEST_ERR: number; - readonly INDEX_SIZE_ERR: number; - readonly INUSE_ATTRIBUTE_ERR: number; - readonly INVALID_ACCESS_ERR: number; - readonly INVALID_CHARACTER_ERR: number; - readonly INVALID_MODIFICATION_ERR: number; - readonly INVALID_NODE_TYPE_ERR: number; - readonly INVALID_STATE_ERR: number; - readonly NAMESPACE_ERR: number; - readonly NETWORK_ERR: number; - readonly NOT_FOUND_ERR: number; - readonly NOT_SUPPORTED_ERR: number; - readonly NO_DATA_ALLOWED_ERR: number; - readonly NO_MODIFICATION_ALLOWED_ERR: number; - readonly QUOTA_EXCEEDED_ERR: number; - readonly SECURITY_ERR: number; - readonly SYNTAX_ERR: number; - readonly TIMEOUT_ERR: number; - readonly TYPE_MISMATCH_ERR: number; - readonly URL_MISMATCH_ERR: number; - readonly VALIDATION_ERR: number; - readonly WRONG_DOCUMENT_ERR: number; -}; - -/** An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. */ -interface DOMImplementation { - createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): XMLDocument; - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createHTMLDocument(title?: string): Document; - /** @deprecated */ - hasFeature(...args: any[]): true; -} - -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -}; - -interface DOMMatrix extends DOMMatrixReadOnly { - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - m11: number; - m12: number; - m13: number; - m14: number; - m21: number; - m22: number; - m23: number; - m24: number; - m31: number; - m32: number; - m33: number; - m34: number; - m41: number; - m42: number; - m43: number; - m44: number; - invertSelf(): DOMMatrix; - multiplySelf(other?: DOMMatrixInit): DOMMatrix; - preMultiplySelf(other?: DOMMatrixInit): DOMMatrix; - rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; - rotateFromVectorSelf(x?: number, y?: number): DOMMatrix; - rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; - scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; - scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; - setMatrixValue(transformList: string): DOMMatrix; - skewXSelf(sx?: number): DOMMatrix; - skewYSelf(sy?: number): DOMMatrix; - translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix; -} - -declare var DOMMatrix: { - prototype: DOMMatrix; - new(init?: string | number[]): DOMMatrix; - fromFloat32Array(array32: Float32Array): DOMMatrix; - fromFloat64Array(array64: Float64Array): DOMMatrix; - fromMatrix(other?: DOMMatrixInit): DOMMatrix; -}; - -type SVGMatrix = DOMMatrix; -declare var SVGMatrix: typeof DOMMatrix; - -type WebKitCSSMatrix = DOMMatrix; -declare var WebKitCSSMatrix: typeof DOMMatrix; - -interface DOMMatrixReadOnly { - readonly a: number; - readonly b: number; - readonly c: number; - readonly d: number; - readonly e: number; - readonly f: number; - readonly is2D: boolean; - readonly isIdentity: boolean; - readonly m11: number; - readonly m12: number; - readonly m13: number; - readonly m14: number; - readonly m21: number; - readonly m22: number; - readonly m23: number; - readonly m24: number; - readonly m31: number; - readonly m32: number; - readonly m33: number; - readonly m34: number; - readonly m41: number; - readonly m42: number; - readonly m43: number; - readonly m44: number; - flipX(): DOMMatrix; - flipY(): DOMMatrix; - inverse(): DOMMatrix; - multiply(other?: DOMMatrixInit): DOMMatrix; - rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; - rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; - rotateFromVector(x?: number, y?: number): DOMMatrix; - scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; - scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; - /** @deprecated */ - scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix; - skewX(sx?: number): DOMMatrix; - skewY(sy?: number): DOMMatrix; - toFloat32Array(): Float32Array; - toFloat64Array(): Float64Array; - toJSON(): any; - transformPoint(point?: DOMPointInit): DOMPoint; - translate(tx?: number, ty?: number, tz?: number): DOMMatrix; - toString(): string; -} - -declare var DOMMatrixReadOnly: { - prototype: DOMMatrixReadOnly; - new(init?: string | number[]): DOMMatrixReadOnly; - fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly; - fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly; - fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly; - toString(): string; -}; - -/** Provides the ability to parse XML or HTML source code from a string into a DOM Document. */ -interface DOMParser { - /** - * Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be "text/html" (which will invoke the HTML parser), or any of "text/xml", "application/xml", "application/xhtml+xml", or "image/svg+xml" (which will invoke the XML parser). - * - * For the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error. - * - * Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8. - * - * Values other than the above for type will cause a TypeError exception to be thrown. - */ - parseFromString(string: string, type: DOMParserSupportedType): Document; -} - -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -}; - -interface DOMPoint extends DOMPointReadOnly { - w: number; - x: number; - y: number; - z: number; -} - -declare var DOMPoint: { - prototype: DOMPoint; - new(x?: number, y?: number, z?: number, w?: number): DOMPoint; - fromPoint(other?: DOMPointInit): DOMPoint; -}; - -type SVGPoint = DOMPoint; -declare var SVGPoint: typeof DOMPoint; - -interface DOMPointReadOnly { - readonly w: number; - readonly x: number; - readonly y: number; - readonly z: number; - matrixTransform(matrix?: DOMMatrixInit): DOMPoint; - toJSON(): any; -} - -declare var DOMPointReadOnly: { - prototype: DOMPointReadOnly; - new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly; - fromPoint(other?: DOMPointInit): DOMPointReadOnly; -}; - -interface DOMQuad { - readonly p1: DOMPoint; - readonly p2: DOMPoint; - readonly p3: DOMPoint; - readonly p4: DOMPoint; - getBounds(): DOMRect; - toJSON(): any; -} - -declare var DOMQuad: { - prototype: DOMQuad; - new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad; - fromQuad(other?: DOMQuadInit): DOMQuad; - fromRect(other?: DOMRectInit): DOMQuad; -}; - -interface DOMRect extends DOMRectReadOnly { - height: number; - width: number; - x: number; - y: number; -} - -declare var DOMRect: { - prototype: DOMRect; - new(x?: number, y?: number, width?: number, height?: number): DOMRect; - fromRect(other?: DOMRectInit): DOMRect; -}; - -type SVGRect = DOMRect; -declare var SVGRect: typeof DOMRect; - -interface DOMRectList { - readonly length: number; - item(index: number): DOMRect | null; - [index: number]: DOMRect; -} - -declare var DOMRectList: { - prototype: DOMRectList; - new(): DOMRectList; -}; - -interface DOMRectReadOnly { - readonly bottom: number; - readonly height: number; - readonly left: number; - readonly right: number; - readonly top: number; - readonly width: number; - readonly x: number; - readonly y: number; - toJSON(): any; -} - -declare var DOMRectReadOnly: { - prototype: DOMRectReadOnly; - new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; - fromRect(other?: DOMRectInit): DOMRectReadOnly; -}; - -/** A type returned by some APIs which contains a list of DOMString (strings). */ -interface DOMStringList { - /** Returns the number of strings in strings. */ - readonly length: number; - /** Returns true if strings contains string, and false otherwise. */ - contains(string: string): boolean; - /** Returns the string with index index from strings. */ - item(index: number): string | null; - [index: number]: string; -} - -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -}; - -/** Used by the dataset HTML attribute to represent data for custom attributes added to elements. */ -interface DOMStringMap { - [name: string]: string | undefined; -} - -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -}; - -/** A set of space-separated tokens. Such a set is returned by Element.classList, HTMLLinkElement.relList, HTMLAnchorElement.relList, HTMLAreaElement.relList, HTMLIframeElement.sandbox, or HTMLOutputElement.htmlFor. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive. */ -interface DOMTokenList { - /** Returns the number of tokens. */ - readonly length: number; - /** - * Returns the associated set as string. - * - * Can be set, to change the associated attribute. - */ - value: string; - toString(): string; - /** - * Adds all arguments passed, except those already present. - * - * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. - * - * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. - */ - add(...tokens: string[]): void; - /** Returns true if token is present, and false otherwise. */ - contains(token: string): boolean; - /** Returns the token with index index. */ - item(index: number): string | null; - /** - * Removes arguments passed, if they are present. - * - * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. - * - * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. - */ - remove(...tokens: string[]): void; - /** - * Replaces token with newToken. - * - * Returns true if token was replaced with newToken, and false otherwise. - * - * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. - * - * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. - */ - replace(token: string, newToken: string): boolean; - /** - * Returns true if token is in the associated attribute's supported tokens. Returns false otherwise. - * - * Throws a TypeError if the associated attribute has no supported tokens defined. - */ - supports(token: string): boolean; - /** - * If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). - * - * Returns true if token is now present, and false otherwise. - * - * Throws a "SyntaxError" DOMException if token is empty. - * - * Throws an "InvalidCharacterError" DOMException if token contains any spaces. - */ - toggle(token: string, force?: boolean): boolean; - forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void; - [index: number]: string; -} - -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -}; - -/** Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. */ -interface DataTransfer { - /** - * Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail. - * - * Can be set, to change the selected operation. - * - * The possible values are "none", "copy", "link", and "move". - */ - dropEffect: "none" | "copy" | "link" | "move"; - /** - * Returns the kinds of operations that are to be allowed. - * - * Can be set (during the dragstart event), to change the allowed operations. - * - * The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", - */ - effectAllowed: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all" | "uninitialized"; - /** Returns a FileList of the files being dragged, if any. */ - readonly files: FileList; - /** Returns a DataTransferItemList object, with the drag data. */ - readonly items: DataTransferItemList; - /** Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string "Files". */ - readonly types: ReadonlyArray; - /** Removes the data of the specified formats. Removes all data if the argument is omitted. */ - clearData(format?: string): void; - /** Returns the specified data. If there is no such data, returns the empty string. */ - getData(format: string): string; - /** Adds the specified data. */ - setData(format: string, data: string): void; - /** Uses the given element to update the drag feedback, replacing any previously specified feedback. */ - setDragImage(image: Element, x: number, y: number): void; -} - -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -}; - -/** One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. */ -interface DataTransferItem { - /** Returns the drag data item kind, one of: "string", "file". */ - readonly kind: string; - /** Returns the drag data item type string. */ - readonly type: string; - /** Returns a File object, if the drag data item kind is File. */ - getAsFile(): File | null; - /** Invokes the callback with the string data as the argument, if the drag data item kind is text. */ - getAsString(callback: FunctionStringCallback | null): void; - webkitGetAsEntry(): FileSystemEntry | null; -} - -declare var DataTransferItem: { - prototype: DataTransferItem; - new(): DataTransferItem; -}; - -/** A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. */ -interface DataTransferItemList { - /** Returns the number of items in the drag data store. */ - readonly length: number; - /** Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also. */ - add(data: string, type: string): DataTransferItem | null; - add(data: File): DataTransferItem | null; - /** Removes all the entries in the drag data store. */ - clear(): void; - /** Removes the indexth entry in the drag data store. */ - remove(index: number): void; - [index: number]: DataTransferItem; -} - -declare var DataTransferItemList: { - prototype: DataTransferItemList; - new(): DataTransferItemList; -}; - -/** A delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. */ -interface DelayNode extends AudioNode { - readonly delayTime: AudioParam; -} - -declare var DelayNode: { - prototype: DelayNode; - new(context: BaseAudioContext, options?: DelayOptions): DelayNode; -}; - -/** - * The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. - * Available only in secure contexts. - */ -interface DeviceMotionEvent extends Event { - readonly acceleration: DeviceMotionEventAcceleration | null; - readonly accelerationIncludingGravity: DeviceMotionEventAcceleration | null; - readonly interval: number; - readonly rotationRate: DeviceMotionEventRotationRate | null; -} - -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; -}; - -/** Available only in secure contexts. */ -interface DeviceMotionEventAcceleration { - readonly x: number | null; - readonly y: number | null; - readonly z: number | null; -} - -/** Available only in secure contexts. */ -interface DeviceMotionEventRotationRate { - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; -} - -/** - * The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page. - * Available only in secure contexts. - */ -interface DeviceOrientationEvent extends Event { - readonly absolute: boolean; - readonly alpha: number | null; - readonly beta: number | null; - readonly gamma: number | null; -} - -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; -}; - -interface DocumentEventMap extends DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap { - "DOMContentLoaded": Event; - "fullscreenchange": Event; - "fullscreenerror": Event; - "pointerlockchange": Event; - "pointerlockerror": Event; - "readystatechange": Event; - "visibilitychange": Event; -} - -/** Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */ -interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase { - /** Sets or gets the URL for the current document. */ - readonly URL: string; - /** - * Sets or gets the color of all active links in the document. - * @deprecated - */ - alinkColor: string; - /** - * Returns a reference to the collection of elements contained by the object. - * @deprecated - */ - readonly all: HTMLAllCollection; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - * @deprecated - */ - readonly anchors: HTMLCollectionOf; - /** - * Retrieves a collection of all applet objects in the document. - * @deprecated - */ - readonly applets: HTMLCollection; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - * @deprecated - */ - bgColor: string; - /** Specifies the beginning and end of the document body. */ - body: HTMLElement; - /** Returns document's encoding. */ - readonly characterSet: string; - /** - * Gets or sets the character set used to encode the object. - * @deprecated This is a legacy alias of `characterSet`. - */ - readonly charset: string; - /** Gets a value that indicates whether standards-compliant mode is switched on for the object. */ - readonly compatMode: string; - /** Returns document's content type. */ - readonly contentType: string; - /** - * Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned. - * - * Can be set, to add a new cookie to the element's set of HTTP cookies. - * - * If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting. - */ - cookie: string; - /** - * Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing. - * - * Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script. - */ - readonly currentScript: HTMLOrSVGScriptElement | null; - /** Returns the Window object of the active document. */ - readonly defaultView: (WindowProxy & typeof globalThis) | null; - /** Sets or gets a value that indicates whether the document can be edited. */ - designMode: string; - /** Sets or retrieves a value that indicates the reading order of the object. */ - dir: string; - /** Gets an object representing the document type declaration associated with the current document. */ - readonly doctype: DocumentType | null; - /** Gets a reference to the root node of the document. */ - readonly documentElement: HTMLElement; - /** Returns document's URL. */ - readonly documentURI: string; - /** Sets or gets the security domain of the document. */ - domain: string; - /** Retrieves a collection of all embed objects in the document. */ - readonly embeds: HTMLCollectionOf; - /** - * Sets or gets the foreground (text) color of the document. - * @deprecated - */ - fgColor: string; - /** Retrieves a collection, in source order, of all form objects in the document. */ - readonly forms: HTMLCollectionOf; - /** @deprecated */ - readonly fullscreen: boolean; - /** Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise. */ - readonly fullscreenEnabled: boolean; - /** Returns the head element. */ - readonly head: HTMLHeadElement; - readonly hidden: boolean; - /** Retrieves a collection, in source order, of img objects in the document. */ - readonly images: HTMLCollectionOf; - /** Gets the implementation object of the current document. */ - readonly implementation: DOMImplementation; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - * @deprecated This is a legacy alias of `characterSet`. - */ - readonly inputEncoding: string; - /** Gets the date that the page was last modified, if the page supplies one. */ - readonly lastModified: string; - /** - * Sets or gets the color of the document links. - * @deprecated - */ - linkColor: string; - /** Retrieves a collection of all a objects that specify the href property and all area objects in the document. */ - readonly links: HTMLCollectionOf; - /** Contains information about the current URL. */ - get location(): Location; - set location(href: string | Location); - onfullscreenchange: ((this: Document, ev: Event) => any) | null; - onfullscreenerror: ((this: Document, ev: Event) => any) | null; - onpointerlockchange: ((this: Document, ev: Event) => any) | null; - onpointerlockerror: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: ((this: Document, ev: Event) => any) | null; - onvisibilitychange: ((this: Document, ev: Event) => any) | null; - readonly ownerDocument: null; - readonly pictureInPictureEnabled: boolean; - /** Return an HTMLCollection of the embed elements in the Document. */ - readonly plugins: HTMLCollectionOf; - /** Retrieves a value that indicates the current state of the object. */ - readonly readyState: DocumentReadyState; - /** Gets the URL of the location that referred the user to the current page. */ - readonly referrer: string; - /** @deprecated */ - readonly rootElement: SVGSVGElement | null; - /** Retrieves a collection of all script objects in the document. */ - readonly scripts: HTMLCollectionOf; - readonly scrollingElement: Element | null; - readonly timeline: DocumentTimeline; - /** Contains the title of the document. */ - title: string; - readonly visibilityState: DocumentVisibilityState; - /** - * Sets or gets the color of the links that the user has visited. - * @deprecated - */ - vlinkColor: string; - /** - * Moves node from another document and returns it. - * - * If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException. - */ - adoptNode(node: T): T; - /** @deprecated */ - captureEvents(): void; - /** @deprecated */ - caretRangeFromPoint(x: number, y: number): Range | null; - /** @deprecated */ - clear(): void; - /** Closes an output stream and forces the sent data to display. */ - close(): void; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(localName: string): Attr; - createAttributeNS(namespace: string | null, qualifiedName: string): Attr; - /** Returns a CDATASection node whose data is data. */ - createCDATASection(data: string): CDATASection; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** Creates a new document. */ - createDocumentFragment(): DocumentFragment; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; - /** @deprecated */ - createElement(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; - createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; - /** - * Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName. - * - * If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown. - * - * If one of the following conditions is true a "NamespaceError" DOMException will be thrown: - * - * localName does not match the QName production. - * Namespace prefix is not null and namespace is the empty string. - * Namespace prefix is "xml" and namespace is not the XML namespace. - * qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. - * namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns". - * - * When supplied, options's is can be used to create a customized built-in element. - */ - createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]; - createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement; - createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element; - createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; - createEvent(eventInterface: "AnimationEvent"): AnimationEvent; - createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent; - createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent; - createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent; - createEvent(eventInterface: "BlobEvent"): BlobEvent; - createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent; - createEvent(eventInterface: "CloseEvent"): CloseEvent; - createEvent(eventInterface: "CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface: "DragEvent"): DragEvent; - createEvent(eventInterface: "ErrorEvent"): ErrorEvent; - createEvent(eventInterface: "Event"): Event; - createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FocusEvent"): FocusEvent; - createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent; - createEvent(eventInterface: "FormDataEvent"): FormDataEvent; - createEvent(eventInterface: "GamepadEvent"): GamepadEvent; - createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent; - createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface: "InputEvent"): InputEvent; - createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent; - createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent; - createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; - createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; - createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; - createEvent(eventInterface: "MediaRecorderErrorEvent"): MediaRecorderErrorEvent; - createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent; - createEvent(eventInterface: "MessageEvent"): MessageEvent; - createEvent(eventInterface: "MouseEvent"): MouseEvent; - createEvent(eventInterface: "MouseEvents"): MouseEvent; - createEvent(eventInterface: "MutationEvent"): MutationEvent; - createEvent(eventInterface: "MutationEvents"): MutationEvent; - createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; - createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent; - createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; - createEvent(eventInterface: "PointerEvent"): PointerEvent; - createEvent(eventInterface: "PopStateEvent"): PopStateEvent; - createEvent(eventInterface: "ProgressEvent"): ProgressEvent; - createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent; - createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; - createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent; - createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent; - createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent; - createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; - createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent; - createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; - createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; - createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; - createEvent(eventInterface: "StorageEvent"): StorageEvent; - createEvent(eventInterface: "SubmitEvent"): SubmitEvent; - createEvent(eventInterface: "TouchEvent"): TouchEvent; - createEvent(eventInterface: "TrackEvent"): TrackEvent; - createEvent(eventInterface: "TransitionEvent"): TransitionEvent; - createEvent(eventInterface: "UIEvent"): UIEvent; - createEvent(eventInterface: "UIEvents"): UIEvent; - createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface: "WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - */ - createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator; - /** Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown. */ - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** Returns an empty range object that has both of its boundary points positioned at the beginning of the document. */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - * @deprecated - */ - execCommand(commandId: string, showUI?: boolean, value?: string): boolean; - /** Stops document's fullscreen element from being displayed fullscreen and resolves promise when done. */ - exitFullscreen(): Promise; - exitPictureInPicture(): Promise; - exitPointerLock(): void; - /** - * Returns a reference to the first object with the specified value of the ID attribute. - * @param elementId String that specifies the ID value. - */ - getElementById(elementId: string): HTMLElement | null; - /** Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. */ - getElementsByClassName(classNames: string): HTMLCollectionOf; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; - /** - * If namespace and localName are "*" returns a HTMLCollection of all descendant elements. - * - * If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName. - * - * If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace. - * - * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName. - */ - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; - /** Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. */ - getSelection(): Selection | null; - /** Gets a value indicating whether the object currently has focus. */ - hasFocus(): boolean; - hasStorageAccess(): Promise; - /** - * Returns a copy of node. If deep is true, the copy also includes the node's descendants. - * - * If node is a document or a shadow root, throws a "NotSupportedError" DOMException. - */ - importNode(node: T, deep?: boolean): T; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(unused1?: string, unused2?: string): Document; - open(url: string | URL, name: string, features: string): WindowProxy | null; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - * @deprecated - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - * @deprecated - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - * @deprecated - */ - queryCommandSupported(commandId: string): boolean; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - /** @deprecated */ - releaseEvents(): void; - requestStorageAccess(): Promise; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...text: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...text: string[]): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -}; - -interface DocumentAndElementEventHandlersEventMap { - "copy": ClipboardEvent; - "cut": ClipboardEvent; - "paste": ClipboardEvent; -} - -interface DocumentAndElementEventHandlers { - oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; - oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; - onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; - addEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -/** A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */ -interface DocumentFragment extends Node, NonElementParentNode, ParentNode { - readonly ownerDocument: Document; - getElementById(elementId: string): HTMLElement | null; -} - -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -}; - -interface DocumentOrShadowRoot { - /** - * Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document. - * - * For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document. - * - * Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not. - */ - readonly activeElement: Element | null; - /** Returns document's fullscreen element. */ - readonly fullscreenElement: Element | null; - readonly pictureInPictureElement: Element | null; - readonly pointerLockElement: Element | null; - /** Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */ - readonly styleSheets: StyleSheetList; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element | null; - elementsFromPoint(x: number, y: number): Element[]; - getAnimations(): Animation[]; -} - -interface DocumentTimeline extends AnimationTimeline { -} - -declare var DocumentTimeline: { - prototype: DocumentTimeline; - new(options?: DocumentTimelineOptions): DocumentTimeline; -}; - -/** A Node containing a doctype. */ -interface DocumentType extends Node, ChildNode { - readonly name: string; - readonly ownerDocument: Document; - readonly publicId: string; - readonly systemId: string; -} - -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -}; - -/** A DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way. */ -interface DragEvent extends MouseEvent { - /** Returns the DataTransfer object for the event. */ - readonly dataTransfer: DataTransfer | null; -} - -declare var DragEvent: { - prototype: DragEvent; - new(type: string, eventInitDict?: DragEventInit): DragEvent; -}; - -/** Inherits properties from its parent, AudioNode. */ -interface DynamicsCompressorNode extends AudioNode { - readonly attack: AudioParam; - readonly knee: AudioParam; - readonly ratio: AudioParam; - readonly reduction: number; - readonly release: AudioParam; - readonly threshold: AudioParam; -} - -declare var DynamicsCompressorNode: { - prototype: DynamicsCompressorNode; - new(context: BaseAudioContext, options?: DynamicsCompressorOptions): DynamicsCompressorNode; -}; - -interface EXT_blend_minmax { - readonly MAX_EXT: GLenum; - readonly MIN_EXT: GLenum; -} - -interface EXT_color_buffer_float { -} - -interface EXT_color_buffer_half_float { - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum; - readonly RGB16F_EXT: GLenum; - readonly RGBA16F_EXT: GLenum; - readonly UNSIGNED_NORMALIZED_EXT: GLenum; -} - -interface EXT_float_blend { -} - -/** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */ -interface EXT_frag_depth { -} - -interface EXT_sRGB { - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum; - readonly SRGB8_ALPHA8_EXT: GLenum; - readonly SRGB_ALPHA_EXT: GLenum; - readonly SRGB_EXT: GLenum; -} - -interface EXT_shader_texture_lod { -} - -interface EXT_texture_compression_rgtc { - readonly COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum; - readonly COMPRESSED_RED_RGTC1_EXT: GLenum; - readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum; - readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum; -} - -/** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */ -interface EXT_texture_filter_anisotropic { - readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum; - readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum; -} - -interface ElementEventMap { - "fullscreenchange": Event; - "fullscreenerror": Event; -} - -/** Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. */ -interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable { - readonly attributes: NamedNodeMap; - /** Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. */ - readonly classList: DOMTokenList; - /** Returns the value of element's class content attribute. Can be set to change it. */ - className: string; - readonly clientHeight: number; - readonly clientLeft: number; - readonly clientTop: number; - readonly clientWidth: number; - /** Returns the value of element's id content attribute. Can be set to change it. */ - id: string; - /** Returns the local name. */ - readonly localName: string; - /** Returns the namespace. */ - readonly namespaceURI: string | null; - onfullscreenchange: ((this: Element, ev: Event) => any) | null; - onfullscreenerror: ((this: Element, ev: Event) => any) | null; - outerHTML: string; - readonly ownerDocument: Document; - readonly part: DOMTokenList; - /** Returns the namespace prefix. */ - readonly prefix: string | null; - readonly scrollHeight: number; - scrollLeft: number; - scrollTop: number; - readonly scrollWidth: number; - /** Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise. */ - readonly shadowRoot: ShadowRoot | null; - /** Returns the value of element's slot content attribute. Can be set to change it. */ - slot: string; - /** Returns the HTML-uppercased qualified name. */ - readonly tagName: string; - /** Creates a shadow root for element and returns it. */ - attachShadow(init: ShadowRootInit): ShadowRoot; - /** Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. */ - closest(selector: K): HTMLElementTagNameMap[K] | null; - closest(selector: K): SVGElementTagNameMap[K] | null; - closest(selectors: string): E | null; - /** Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. */ - getAttribute(qualifiedName: string): string | null; - /** Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. */ - getAttributeNS(namespace: string | null, localName: string): string | null; - /** Returns the qualified names of all element's attributes. Can contain duplicates. */ - getAttributeNames(): string[]; - getAttributeNode(qualifiedName: string): Attr | null; - getAttributeNodeNS(namespace: string | null, localName: string): Attr | null; - getBoundingClientRect(): DOMRect; - getClientRects(): DOMRectList; - /** Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. */ - getElementsByClassName(classNames: string): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: K): HTMLCollectionOf; - getElementsByTagName(qualifiedName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; - /** Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. */ - hasAttribute(qualifiedName: string): boolean; - /** Returns true if element has an attribute whose namespace is namespace and local name is localName. */ - hasAttributeNS(namespace: string | null, localName: string): boolean; - /** Returns true if element has attributes, and false otherwise. */ - hasAttributes(): boolean; - hasPointerCapture(pointerId: number): boolean; - insertAdjacentElement(where: InsertPosition, element: Element): Element | null; - insertAdjacentHTML(position: InsertPosition, text: string): void; - insertAdjacentText(where: InsertPosition, data: string): void; - /** Returns true if matching selectors against element's root yields element, and false otherwise. */ - matches(selectors: string): boolean; - releasePointerCapture(pointerId: number): void; - /** Removes element's first attribute whose qualified name is qualifiedName. */ - removeAttribute(qualifiedName: string): void; - /** Removes element's attribute whose namespace is namespace and local name is localName. */ - removeAttributeNS(namespace: string | null, localName: string): void; - removeAttributeNode(attr: Attr): Attr; - /** - * Displays element fullscreen and resolves promise when done. - * - * When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference. - */ - requestFullscreen(options?: FullscreenOptions): Promise; - requestPointerLock(): void; - scroll(options?: ScrollToOptions): void; - scroll(x: number, y: number): void; - scrollBy(options?: ScrollToOptions): void; - scrollBy(x: number, y: number): void; - scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; - scrollTo(options?: ScrollToOptions): void; - scrollTo(x: number, y: number): void; - /** Sets the value of element's first attribute whose qualified name is qualifiedName to value. */ - setAttribute(qualifiedName: string, value: string): void; - /** Sets the value of element's attribute whose namespace is namespace and local name is localName to value. */ - setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void; - setAttributeNode(attr: Attr): Attr | null; - setAttributeNodeNS(attr: Attr): Attr | null; - setPointerCapture(pointerId: number): void; - /** - * If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName. - * - * Returns true if qualifiedName is now present, and false otherwise. - */ - toggleAttribute(qualifiedName: string, force?: boolean): boolean; - /** @deprecated This is a legacy alias of `matches`. */ - webkitMatchesSelector(selectors: string): boolean; - addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var Element: { - prototype: Element; - new(): Element; -}; - -interface ElementCSSInlineStyle { - readonly style: CSSStyleDeclaration; -} - -interface ElementContentEditable { - contentEditable: string; - enterKeyHint: string; - inputMode: string; - readonly isContentEditable: boolean; -} - -interface ElementInternals extends ARIAMixin { - /** Returns the form owner of internals's target element. */ - readonly form: HTMLFormElement | null; - /** Returns a NodeList of all the label elements that internals's target element is associated with. */ - readonly labels: NodeList; - /** Returns the ShadowRoot for internals's target element, if the target element is a shadow host, or null otherwise. */ - readonly shadowRoot: ShadowRoot | null; - /** Returns true if internals's target element will be validated when the form is submitted; false otherwise. */ - readonly willValidate: boolean; - /** - * Sets both the state and submission value of internals's target element to value. - * - * If value is null, the element won't participate in form submission. - */ - setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void; -} - -declare var ElementInternals: { - prototype: ElementInternals; - new(): ElementInternals; -}; - -/** Events providing information related to errors in scripts or in files. */ -interface ErrorEvent extends Event { - readonly colno: number; - readonly error: any; - readonly filename: string; - readonly lineno: number; - readonly message: string; -} - -declare var ErrorEvent: { - prototype: ErrorEvent; - new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent; -}; - -/** An event which takes place in the DOM. */ -interface Event { - /** Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. */ - readonly bubbles: boolean; - cancelBubble: boolean; - /** Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. */ - readonly cancelable: boolean; - /** Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. */ - readonly composed: boolean; - /** Returns the object whose event listener's callback is currently being invoked. */ - readonly currentTarget: EventTarget | null; - /** Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. */ - readonly defaultPrevented: boolean; - /** Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. */ - readonly eventPhase: number; - /** Returns true if event was dispatched by the user agent, and false otherwise. */ - readonly isTrusted: boolean; - /** @deprecated */ - returnValue: boolean; - /** @deprecated */ - readonly srcElement: EventTarget | null; - /** Returns the object to which event is dispatched (its target). */ - readonly target: EventTarget | null; - /** Returns the event's timestamp as the number of milliseconds measured relative to the time origin. */ - readonly timeStamp: DOMHighResTimeStamp; - /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ - readonly type: string; - /** Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. */ - composedPath(): EventTarget[]; - /** @deprecated */ - initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; - /** If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. */ - preventDefault(): void; - /** Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. */ - stopImmediatePropagation(): void; - /** When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. */ - stopPropagation(): void; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; -} - -declare var Event: { - prototype: Event; - new(type: string, eventInitDict?: EventInit): Event; - readonly AT_TARGET: number; - readonly BUBBLING_PHASE: number; - readonly CAPTURING_PHASE: number; - readonly NONE: number; -}; - -interface EventCounts { - forEach(callbackfn: (value: number, key: string, parent: EventCounts) => void, thisArg?: any): void; -} - -declare var EventCounts: { - prototype: EventCounts; - new(): EventCounts; -}; - -interface EventListener { - (evt: Event): void; -} - -interface EventListenerObject { - handleEvent(object: Event): void; -} - -interface EventSourceEventMap { - "error": Event; - "message": MessageEvent; - "open": Event; -} - -interface EventSource extends EventTarget { - onerror: ((this: EventSource, ev: Event) => any) | null; - onmessage: ((this: EventSource, ev: MessageEvent) => any) | null; - onopen: ((this: EventSource, ev: Event) => any) | null; - /** Returns the state of this EventSource object's connection. It can have the values described below. */ - readonly readyState: number; - /** Returns the URL providing the event stream. */ - readonly url: string; - /** Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise. */ - readonly withCredentials: boolean; - /** Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. */ - close(): void; - readonly CLOSED: number; - readonly CONNECTING: number; - readonly OPEN: number; - addEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var EventSource: { - prototype: EventSource; - new(url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource; - readonly CLOSED: number; - readonly CONNECTING: number; - readonly OPEN: number; -}; - -/** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */ -interface EventTarget { - /** - * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. - * - * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. - * - * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. - * - * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners. - * - * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. - * - * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. - * - * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. - */ - addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; - /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ - dispatchEvent(event: Event): boolean; - /** Removes the event listener in target's event listener list with the same type, callback, and options. */ - removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; -} - -declare var EventTarget: { - prototype: EventTarget; - new(): EventTarget; -}; - -/** @deprecated */ -interface External { - /** @deprecated */ - AddSearchProvider(): void; - /** @deprecated */ - IsSearchProviderInstalled(): void; -} - -/** @deprecated */ -declare var External: { - prototype: External; - new(): External; -}; - -/** Provides information about files and allows JavaScript in a web page to access their content. */ -interface File extends Blob { - readonly lastModified: number; - readonly name: string; - readonly webkitRelativePath: string; -} - -declare var File: { - prototype: File; - new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; -}; - -/** An object of this type is returned by the files property of the HTML element; this lets you access the list of files selected with the element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */ -interface FileList { - readonly length: number; - item(index: number): File | null; - [index: number]: File; -} - -declare var FileList: { - prototype: FileList; - new(): FileList; -}; - -interface FileReaderEventMap { - "abort": ProgressEvent; - "error": ProgressEvent; - "load": ProgressEvent; - "loadend": ProgressEvent; - "loadstart": ProgressEvent; - "progress": ProgressEvent; -} - -/** Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */ -interface FileReader extends EventTarget { - readonly error: DOMException | null; - onabort: ((this: FileReader, ev: ProgressEvent) => any) | null; - onerror: ((this: FileReader, ev: ProgressEvent) => any) | null; - onload: ((this: FileReader, ev: ProgressEvent) => any) | null; - onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; - onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; - onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; - readonly readyState: number; - readonly result: string | ArrayBuffer | null; - abort(): void; - readAsArrayBuffer(blob: Blob): void; - readAsBinaryString(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; - addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var FileReader: { - prototype: FileReader; - new(): FileReader; - readonly DONE: number; - readonly EMPTY: number; - readonly LOADING: number; -}; - -interface FileSystem { - readonly name: string; - readonly root: FileSystemDirectoryEntry; -} - -declare var FileSystem: { - prototype: FileSystem; - new(): FileSystem; -}; - -interface FileSystemDirectoryEntry extends FileSystemEntry { - createReader(): FileSystemDirectoryReader; - getDirectory(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; - getFile(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; -} - -declare var FileSystemDirectoryEntry: { - prototype: FileSystemDirectoryEntry; - new(): FileSystemDirectoryEntry; -}; - -/** Available only in secure contexts. */ -interface FileSystemDirectoryHandle extends FileSystemHandle { - readonly kind: "directory"; - getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise; - getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise; - removeEntry(name: string, options?: FileSystemRemoveOptions): Promise; - resolve(possibleDescendant: FileSystemHandle): Promise; -} - -declare var FileSystemDirectoryHandle: { - prototype: FileSystemDirectoryHandle; - new(): FileSystemDirectoryHandle; -}; - -interface FileSystemDirectoryReader { - readEntries(successCallback: FileSystemEntriesCallback, errorCallback?: ErrorCallback): void; -} - -declare var FileSystemDirectoryReader: { - prototype: FileSystemDirectoryReader; - new(): FileSystemDirectoryReader; -}; - -interface FileSystemEntry { - readonly filesystem: FileSystem; - readonly fullPath: string; - readonly isDirectory: boolean; - readonly isFile: boolean; - readonly name: string; - getParent(successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; -} - -declare var FileSystemEntry: { - prototype: FileSystemEntry; - new(): FileSystemEntry; -}; - -interface FileSystemFileEntry extends FileSystemEntry { - file(successCallback: FileCallback, errorCallback?: ErrorCallback): void; -} - -declare var FileSystemFileEntry: { - prototype: FileSystemFileEntry; - new(): FileSystemFileEntry; -}; - -/** Available only in secure contexts. */ -interface FileSystemFileHandle extends FileSystemHandle { - readonly kind: "file"; - getFile(): Promise; -} - -declare var FileSystemFileHandle: { - prototype: FileSystemFileHandle; - new(): FileSystemFileHandle; -}; - -/** Available only in secure contexts. */ -interface FileSystemHandle { - readonly kind: FileSystemHandleKind; - readonly name: string; - isSameEntry(other: FileSystemHandle): Promise; -} - -declare var FileSystemHandle: { - prototype: FileSystemHandle; - new(): FileSystemHandle; -}; - -/** Focus-related events like focus, blur, focusin, or focusout. */ -interface FocusEvent extends UIEvent { - readonly relatedTarget: EventTarget | null; -} - -declare var FocusEvent: { - prototype: FocusEvent; - new(type: string, eventInitDict?: FocusEventInit): FocusEvent; -}; - -interface FontFace { - ascentOverride: string; - descentOverride: string; - display: string; - family: string; - featureSettings: string; - lineGapOverride: string; - readonly loaded: Promise; - readonly status: FontFaceLoadStatus; - stretch: string; - style: string; - unicodeRange: string; - variant: string; - variationSettings: string; - weight: string; - load(): Promise; -} - -declare var FontFace: { - prototype: FontFace; - new(family: string, source: string | BinaryData, descriptors?: FontFaceDescriptors): FontFace; -}; - -interface FontFaceSetEventMap { - "loading": Event; - "loadingdone": Event; - "loadingerror": Event; -} - -interface FontFaceSet extends EventTarget { - onloading: ((this: FontFaceSet, ev: Event) => any) | null; - onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null; - onloadingerror: ((this: FontFaceSet, ev: Event) => any) | null; - readonly ready: Promise; - readonly status: FontFaceSetLoadStatus; - check(font: string, text?: string): boolean; - load(font: string, text?: string): Promise; - forEach(callbackfn: (value: FontFace, key: FontFace, parent: FontFaceSet) => void, thisArg?: any): void; - addEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var FontFaceSet: { - prototype: FontFaceSet; - new(initialFaces: FontFace[]): FontFaceSet; -}; - -interface FontFaceSetLoadEvent extends Event { - readonly fontfaces: ReadonlyArray; -} - -declare var FontFaceSetLoadEvent: { - prototype: FontFaceSetLoadEvent; - new(type: string, eventInitDict?: FontFaceSetLoadEventInit): FontFaceSetLoadEvent; -}; - -interface FontFaceSource { - readonly fonts: FontFaceSet; -} - -/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */ -interface FormData { - append(name: string, value: string | Blob, fileName?: string): void; - delete(name: string): void; - get(name: string): FormDataEntryValue | null; - getAll(name: string): FormDataEntryValue[]; - has(name: string): boolean; - set(name: string, value: string | Blob, fileName?: string): void; - forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void; -} - -declare var FormData: { - prototype: FormData; - new(form?: HTMLFormElement): FormData; -}; - -interface FormDataEvent extends Event { - /** Returns a FormData object representing names and values of elements associated to the target form. Operations on the FormData object will affect form data to be submitted. */ - readonly formData: FormData; -} - -declare var FormDataEvent: { - prototype: FormDataEvent; - new(type: string, eventInitDict: FormDataEventInit): FormDataEvent; -}; - -/** A change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. */ -interface GainNode extends AudioNode { - readonly gain: AudioParam; -} - -declare var GainNode: { - prototype: GainNode; - new(context: BaseAudioContext, options?: GainOptions): GainNode; -}; - -/** - * This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. - * Available only in secure contexts. - */ -interface Gamepad { - readonly axes: ReadonlyArray; - readonly buttons: ReadonlyArray; - readonly connected: boolean; - readonly hapticActuators: ReadonlyArray; - readonly id: string; - readonly index: number; - readonly mapping: GamepadMappingType; - readonly timestamp: DOMHighResTimeStamp; -} - -declare var Gamepad: { - prototype: Gamepad; - new(): Gamepad; -}; - -/** - * An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. - * Available only in secure contexts. - */ -interface GamepadButton { - readonly pressed: boolean; - readonly touched: boolean; - readonly value: number; -} - -declare var GamepadButton: { - prototype: GamepadButton; - new(): GamepadButton; -}; - -/** - * This Gamepad API interface contains references to gamepads connected to the system, which is what the gamepad events Window.gamepadconnected and Window.gamepaddisconnected are fired in response to. - * Available only in secure contexts. - */ -interface GamepadEvent extends Event { - readonly gamepad: Gamepad; -} - -declare var GamepadEvent: { - prototype: GamepadEvent; - new(type: string, eventInitDict: GamepadEventInit): GamepadEvent; -}; - -/** This Gamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. */ -interface GamepadHapticActuator { - readonly type: GamepadHapticActuatorType; -} - -declare var GamepadHapticActuator: { - prototype: GamepadHapticActuator; - new(): GamepadHapticActuator; -}; - -interface GenericTransformStream { - readonly readable: ReadableStream; - readonly writable: WritableStream; -} - -/** An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. */ -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): number; -} - -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -}; - -/** Available only in secure contexts. */ -interface GeolocationCoordinates { - readonly accuracy: number; - readonly altitude: number | null; - readonly altitudeAccuracy: number | null; - readonly heading: number | null; - readonly latitude: number; - readonly longitude: number; - readonly speed: number | null; -} - -declare var GeolocationCoordinates: { - prototype: GeolocationCoordinates; - new(): GeolocationCoordinates; -}; - -/** Available only in secure contexts. */ -interface GeolocationPosition { - readonly coords: GeolocationCoordinates; - readonly timestamp: EpochTimeStamp; -} - -declare var GeolocationPosition: { - prototype: GeolocationPosition; - new(): GeolocationPosition; -}; - -interface GeolocationPositionError { - readonly code: number; - readonly message: string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -declare var GeolocationPositionError: { - prototype: GeolocationPositionError; - new(): GeolocationPositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -}; - -interface GlobalEventHandlersEventMap { - "abort": UIEvent; - "animationcancel": AnimationEvent; - "animationend": AnimationEvent; - "animationiteration": AnimationEvent; - "animationstart": AnimationEvent; - "auxclick": MouseEvent; - "beforeinput": InputEvent; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "close": Event; - "compositionend": CompositionEvent; - "compositionstart": CompositionEvent; - "compositionupdate": CompositionEvent; - "contextmenu": MouseEvent; - "cuechange": Event; - "dblclick": MouseEvent; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": Event; - "error": ErrorEvent; - "focus": FocusEvent; - "focusin": FocusEvent; - "focusout": FocusEvent; - "formdata": FormDataEvent; - "gotpointercapture": PointerEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "lostpointercapture": PointerEvent; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "pause": Event; - "play": Event; - "playing": Event; - "pointercancel": PointerEvent; - "pointerdown": PointerEvent; - "pointerenter": PointerEvent; - "pointerleave": PointerEvent; - "pointermove": PointerEvent; - "pointerout": PointerEvent; - "pointerover": PointerEvent; - "pointerup": PointerEvent; - "progress": ProgressEvent; - "ratechange": Event; - "reset": Event; - "resize": UIEvent; - "scroll": Event; - "securitypolicyviolation": SecurityPolicyViolationEvent; - "seeked": Event; - "seeking": Event; - "select": Event; - "selectionchange": Event; - "selectstart": Event; - "slotchange": Event; - "stalled": Event; - "submit": SubmitEvent; - "suspend": Event; - "timeupdate": Event; - "toggle": Event; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "transitioncancel": TransitionEvent; - "transitionend": TransitionEvent; - "transitionrun": TransitionEvent; - "transitionstart": TransitionEvent; - "volumechange": Event; - "waiting": Event; - "webkitanimationend": Event; - "webkitanimationiteration": Event; - "webkitanimationstart": Event; - "webkittransitionend": Event; - "wheel": WheelEvent; -} - -interface GlobalEventHandlers { - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; - onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; - onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; - onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; - onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; - onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; - oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: OnErrorEventHandler; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; - onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null; - ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; - oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - * @deprecated - */ - onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; - ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; - ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; - ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; - ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; - ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; - ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; - ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; - ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; - ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** @deprecated This is a legacy alias of `onanimationend`. */ - onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** @deprecated This is a legacy alias of `onanimationiteration`. */ - onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** @deprecated This is a legacy alias of `onanimationstart`. */ - onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; - /** @deprecated This is a legacy alias of `ontransitionend`. */ - onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; - addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -interface HTMLAllCollection { - /** Returns the number of elements in the collection. */ - readonly length: number; - /** Returns the item with index index from the collection (determined by tree order). */ - item(nameOrIndex?: string): HTMLCollection | Element | null; - /** - * Returns the item with ID or name name from the collection. - * - * If there are multiple matching items, then an HTMLCollection object containing all those elements is returned. - * - * Only button, form, iframe, input, map, meta, object, select, and textarea elements can have a name for the purpose of this method; their name is given by the value of their name attribute. - */ - namedItem(name: string): HTMLCollection | Element | null; - [index: number]: Element; -} - -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -}; - -/** Hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. */ -interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { - /** - * Sets or retrieves the character set used to encode the object. - * @deprecated - */ - charset: string; - /** - * Sets or retrieves the coordinates of the object. - * @deprecated - */ - coords: string; - download: string; - /** Sets or retrieves the language code of the object. */ - hreflang: string; - /** - * Sets or retrieves the shape of the object. - * @deprecated - */ - name: string; - ping: string; - referrerPolicy: string; - /** Sets or retrieves the relationship between the object and the destination of the link. */ - rel: string; - readonly relList: DOMTokenList; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - * @deprecated - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - * @deprecated - */ - shape: string; - /** Sets or retrieves the window or frame at which to target content. */ - target: string; - /** Retrieves or sets the text of the object as a string. */ - text: string; - type: string; - addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -}; - -/** Provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of elements. */ -interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils { - /** Sets or retrieves a text alternative to the graphic. */ - alt: string; - /** Sets or retrieves the coordinates of the object. */ - coords: string; - download: string; - /** - * Sets or gets whether clicks in this region cause action. - * @deprecated - */ - noHref: boolean; - ping: string; - referrerPolicy: string; - rel: string; - readonly relList: DOMTokenList; - /** Sets or retrieves the shape of the object. */ - shape: string; - /** Sets or retrieves the window or frame at which to target content. */ - target: string; - addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -}; - -/** Provides access to the properties of