Dramatically improving the build time of web-sys (#2012)

* Pre-generating web-sys

* Fixing build errors

* Minor refactor for the unit tests

* Changing to generate #[wasm_bindgen} annotations

* Fixing code generation

* Adding in main bin to wasm-bindgen-webidl

* Fixing more problems

* Adding in support for unstable APIs

* Fixing bug with code generation

* More code generation fixes

* Improving the webidl program

* Removing unnecessary cfg from the generated code

* Splitting doc comments onto separate lines

* Improving the generation for unstable features

* Adding in support for string values in enums

* Now runs rustfmt on the mod.rs file

* Fixing codegen for constructors

* Fixing webidl-tests

* Fixing build errors

* Another fix for build errors

* Renaming typescript_name to typescript_type

* Adding in docs for typescript_type

* Adding in CI script to verify that web-sys is up to date

* Fixing CI script

* Fixing CI script

* Don't suppress git diff output

* Remove duplicate definitions of `Location`

Looks to be a preexisting bug in wasm-bindgen?

* Regenerate webidl

* Try to get the git diff command right

* Handle named constructors in WebIDL

* Remove stray rustfmt.toml

* Add back NamedConstructorBar definition in tests

* Run stable rustfmt over everything

* Don't run Cargo in a build script

Instead refactor things so webidl-tests can use the Rust-code-generation
as a library in a build script. Also fixes `cargo fmt` in the
repository.

* Fixup generated code

* Running web-sys checks on stable

* Improving the code generation a little

* Running rustfmt

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
This commit is contained in:
Pauan 2020-03-03 00:39:36 +01:00 committed by GitHub
parent eb04cf2dda
commit 3f4acc453b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1344 changed files with 142082 additions and 2883 deletions

View File

@ -114,6 +114,13 @@ jobs:
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
- job: check_web_sys
displayName: "Verify that web-sys is compiled correctly"
steps:
- template: ci/azure-install-rust.yml
- script: cd crates/web-sys && cargo run --release --package wasm-bindgen-webidl webidls src/features
- script: git diff --exit-code
- job: test_js_sys
displayName: "Run js-sys crate tests"
steps:

View File

@ -17,18 +17,24 @@ pub struct Program {
pub enums: Vec<Enum>,
/// rust structs
pub structs: Vec<Struct>,
/// rust consts
pub consts: Vec<Const>,
/// "dictionaries", generated for WebIDL, which are basically just "typed
/// objects" in the sense that they represent a JS object with a particular
/// shape in JIT parlance.
pub dictionaries: Vec<Dictionary>,
/// custom typescript sections to be included in the definition file
pub typescript_custom_sections: Vec<String>,
/// Inline JS snippets
pub inline_js: Vec<String>,
}
impl Program {
/// Returns true if the Program is empty
pub fn is_empty(&self) -> bool {
self.exports.is_empty()
&& self.imports.is_empty()
&& self.enums.is_empty()
&& self.structs.is_empty()
&& self.typescript_custom_sections.is_empty()
&& self.inline_js.is_empty()
}
}
/// A rust to js interface. Allows interaction with rust objects/functions
/// from javascript.
#[cfg_attr(feature = "extra-traits", derive(Debug))]
@ -51,8 +57,6 @@ pub struct Export {
/// Whether or not this function should be flagged as the wasm start
/// function.
pub start: bool,
/// Whether the API is unstable. This is only used internally.
pub unstable_api: bool,
}
/// The 3 types variations of `self`.
@ -73,7 +77,6 @@ pub struct Import {
pub module: ImportModule,
pub js_namespace: Option<Ident>,
pub kind: ImportKind,
pub unstable_api: bool,
}
#[cfg_attr(feature = "extra-traits", derive(Debug))]
@ -129,7 +132,6 @@ pub struct ImportFunction {
pub kind: ImportFunctionKind,
pub shim: Ident,
pub doc_comment: Option<String>,
pub unstable_api: bool,
}
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
@ -185,8 +187,7 @@ pub struct ImportType {
pub rust_name: Ident,
pub js_name: String,
pub attrs: Vec<syn::Attribute>,
pub typescript_name: Option<String>,
pub unstable_api: bool,
pub typescript_type: Option<String>,
pub doc_comment: Option<String>,
pub instanceof_shim: String,
pub is_type_of: Option<syn::Expr>,
@ -207,8 +208,6 @@ pub struct ImportEnum {
pub variant_values: Vec<String>,
/// Attributes to apply to the Rust enum
pub rust_attrs: Vec<syn::Attribute>,
/// Whether the enum is part of an unstable WebIDL
pub unstable_api: bool,
}
#[cfg_attr(feature = "extra-traits", derive(Debug))]
@ -244,7 +243,6 @@ pub struct StructField {
pub getter: Ident,
pub setter: Ident,
pub comments: Vec<String>,
pub unstable_api: bool,
}
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
@ -254,7 +252,6 @@ pub struct Enum {
pub variants: Vec<Variant>,
pub comments: Vec<String>,
pub hole: u32,
pub unstable_api: bool,
}
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
@ -279,49 +276,6 @@ pub enum TypeLocation {
ExportRet,
}
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq))]
#[derive(Clone)]
pub struct Const {
pub vis: syn::Visibility,
pub name: Ident,
pub class: Option<Ident>,
pub ty: syn::Type,
pub value: ConstValue,
pub unstable_api: bool,
}
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq))]
#[derive(Clone)]
/// same as webidl::ast::ConstValue
pub enum ConstValue {
BooleanLiteral(bool),
FloatLiteral(f64),
SignedIntegerLiteral(i64),
UnsignedIntegerLiteral(u64),
Null,
}
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
#[derive(Clone)]
pub struct Dictionary {
pub name: Ident,
pub fields: Vec<DictionaryField>,
pub ctor: bool,
pub doc_comment: Option<String>,
pub ctor_doc_comment: Option<String>,
pub unstable_api: bool,
}
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
#[derive(Clone)]
pub struct DictionaryField {
pub rust_name: Ident,
pub js_name: String,
pub required: bool,
pub ty: syn::Type,
pub doc_comment: Option<String>,
}
impl Export {
/// Mangles a rust -> javascript export, so that the created Ident will be unique over function
/// name and class name, if the function belongs to a javascript class.

View File

@ -1,6 +1,6 @@
use crate::ast;
use crate::encode;
use crate::util::{self, ShortHash};
use crate::util::ShortHash;
use crate::Diagnostic;
use proc_macro2::{Ident, Literal, Span, TokenStream};
use quote::{quote, ToTokens};
@ -39,11 +39,7 @@ impl TryToTokens for ast::Program {
}
}
for i in self.imports.iter() {
DescribeImport {
kind: &i.kind,
unstable_api: i.unstable_api,
}
.to_tokens(tokens);
DescribeImport { kind: &i.kind }.to_tokens(tokens);
// If there is a js namespace, check that name isn't a type. If it is,
// this import might be a method on that type.
@ -68,12 +64,6 @@ impl TryToTokens for ast::Program {
for e in self.enums.iter() {
e.to_tokens(tokens);
}
for c in self.consts.iter() {
c.to_tokens(tokens);
}
for d in self.dictionaries.iter() {
d.to_tokens(tokens);
}
Diagnostic::from_vec(errors)?;
@ -305,7 +295,7 @@ impl ToTokens for ast::StructField {
inner: quote! {
<#ty as WasmDescribe>::describe();
},
unstable_api: self.unstable_api,
attrs: vec![],
}
.to_tokens(tokens);
@ -542,7 +532,7 @@ impl TryToTokens for ast::Export {
#(<#argtys as WasmDescribe>::describe();)*
#describe_ret
},
unstable_api: self.unstable_api,
attrs: attrs.clone(),
}
.to_tokens(into);
@ -568,7 +558,6 @@ impl ToTokens for ast::ImportType {
let vis = &self.vis;
let rust_name = &self.rust_name;
let attrs = &self.attrs;
let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api);
let doc_comment = match &self.doc_comment {
None => "",
Some(comment) => comment,
@ -586,14 +575,14 @@ impl ToTokens for ast::ImportType {
}
};
let description = if let Some(typescript_name) = &self.typescript_name {
let typescript_name_len = typescript_name.len() as u32;
let typescript_name_chars = typescript_name.chars().map(|c| c as u32);
let description = if let Some(typescript_type) = &self.typescript_type {
let typescript_type_len = typescript_type.len() as u32;
let typescript_type_chars = typescript_type.chars().map(|c| c as u32);
quote! {
use wasm_bindgen::describe::*;
inform(NAMED_ANYREF);
inform(#typescript_name_len);
#(inform(#typescript_name_chars);)*
inform(#typescript_type_len);
#(inform(#typescript_type_chars);)*
}
} else {
quote! {
@ -617,14 +606,12 @@ impl ToTokens for ast::ImportType {
#[doc = #doc_comment]
#[repr(transparent)]
#[allow(clippy::all)]
#unstable_api_attr
#vis struct #rust_name {
obj: #internal_obj
}
#[allow(bad_style)]
#[allow(clippy::all)]
#unstable_api_attr
const #const_name: () = {
use wasm_bindgen::convert::{IntoWasmAbi, FromWasmAbi};
use wasm_bindgen::convert::{OptionIntoWasmAbi, OptionFromWasmAbi};
@ -775,7 +762,6 @@ impl ToTokens for ast::ImportType {
for superclass in self.extends.iter() {
(quote! {
#[allow(clippy::all)]
#unstable_api_attr
impl From<#rust_name> for #superclass {
#[inline]
fn from(obj: #rust_name) -> #superclass {
@ -785,7 +771,6 @@ impl ToTokens for ast::ImportType {
}
#[allow(clippy::all)]
#unstable_api_attr
impl AsRef<#superclass> for #rust_name {
#[inline]
fn as_ref(&self) -> &#superclass {
@ -807,7 +792,6 @@ impl ToTokens for ast::ImportEnum {
let variants = &self.variants;
let variant_strings = &self.variant_values;
let attrs = &self.rust_attrs;
let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api);
let mut current_idx: usize = 0;
let variant_indexes: Vec<Literal> = variants
@ -836,7 +820,6 @@ impl ToTokens for ast::ImportEnum {
#[allow(bad_style)]
#(#attrs)*
#[allow(clippy::all)]
#unstable_api_attr
#vis enum #name {
#(#variants = #variant_indexes_ref,)*
#[doc(hidden)]
@ -844,69 +827,70 @@ impl ToTokens for ast::ImportEnum {
}
#[allow(clippy::all)]
#unstable_api_attr
impl #name {
#vis fn from_js_value(obj: &wasm_bindgen::JsValue) -> Option<#name> {
obj.as_string().and_then(|obj_str| match obj_str.as_str() {
fn from_str(s: &str) -> Option<#name> {
match s {
#(#variant_strings => Some(#variant_paths_ref),)*
_ => None,
})
}
}
fn to_str(&self) -> &'static str {
match self {
#(#variant_paths_ref => #variant_strings,)*
#name::__Nonexhaustive => panic!(#expect_string),
}
}
#vis fn from_js_value(obj: &wasm_bindgen::JsValue) -> Option<#name> {
obj.as_string().and_then(|obj_str| Self::from_str(obj_str.as_str()))
}
}
// It should really be using &str for all of these, but that requires some major changes to cli-support
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::describe::WasmDescribe for #name {
fn describe() {
wasm_bindgen::JsValue::describe()
<wasm_bindgen::JsValue as wasm_bindgen::describe::WasmDescribe>::describe()
}
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::IntoWasmAbi for #name {
type Abi = <wasm_bindgen::JsValue as
wasm_bindgen::convert::IntoWasmAbi>::Abi;
type Abi = <wasm_bindgen::JsValue as wasm_bindgen::convert::IntoWasmAbi>::Abi;
#[inline]
fn into_abi(self) -> Self::Abi {
wasm_bindgen::JsValue::from(self).into_abi()
<wasm_bindgen::JsValue as wasm_bindgen::convert::IntoWasmAbi>::into_abi(self.into())
}
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::FromWasmAbi for #name {
type Abi = <wasm_bindgen::JsValue as
wasm_bindgen::convert::FromWasmAbi>::Abi;
type Abi = <wasm_bindgen::JsValue as wasm_bindgen::convert::FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self {
#name::from_js_value(&wasm_bindgen::JsValue::from_abi(js)).unwrap_or(#name::__Nonexhaustive)
let s = <wasm_bindgen::JsValue as wasm_bindgen::convert::FromWasmAbi>::from_abi(js);
#name::from_js_value(&s).unwrap_or(#name::__Nonexhaustive)
}
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::OptionIntoWasmAbi for #name {
#[inline]
fn none() -> Self::Abi { Object::none() }
fn none() -> Self::Abi { <::js_sys::Object as wasm_bindgen::convert::OptionIntoWasmAbi>::none() }
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::OptionFromWasmAbi for #name {
#[inline]
fn is_none(abi: &Self::Abi) -> bool { Object::is_none(abi) }
fn is_none(abi: &Self::Abi) -> bool { <::js_sys::Object as wasm_bindgen::convert::OptionFromWasmAbi>::is_none(abi) }
}
#[allow(clippy::all)]
#unstable_api_attr
impl From<#name> for wasm_bindgen::JsValue {
fn from(obj: #name) -> wasm_bindgen::JsValue {
match obj {
#(#variant_paths_ref => wasm_bindgen::JsValue::from_str(#variant_strings),)*
#name::__Nonexhaustive => panic!(#expect_string),
}
wasm_bindgen::JsValue::from(obj.to_str())
}
}
}).to_tokens(tokens);
@ -1012,7 +996,6 @@ impl TryToTokens for ast::ImportFunction {
let arguments = &arguments;
let abi_arguments = &abi_arguments;
let abi_argument_names = &abi_argument_names;
let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api);
let doc_comment = match &self.doc_comment {
None => "",
@ -1041,6 +1024,7 @@ impl TryToTokens for ast::ImportFunction {
// the best we can in the meantime.
let extern_fn = respan(
quote! {
#(#attrs)*
#[link(wasm_import_module = "__wbindgen_placeholder__")]
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
extern "C" {
@ -1079,7 +1063,6 @@ impl TryToTokens for ast::ImportFunction {
if let Some(class) = class_ty {
(quote! {
#unstable_api_attr
impl #class {
#invocation
}
@ -1096,7 +1079,6 @@ impl TryToTokens for ast::ImportFunction {
// See comment above in ast::Export for what's going on here.
struct DescribeImport<'a> {
kind: &'a ast::ImportKind,
unstable_api: bool,
}
impl<'a> ToTokens for DescribeImport<'a> {
@ -1123,7 +1105,7 @@ impl<'a> ToTokens for DescribeImport<'a> {
#(<#argtys as WasmDescribe>::describe();)*
#inform_ret
},
unstable_api: self.unstable_api,
attrs: f.function.rust_attrs.clone(),
}
.to_tokens(tokens);
}
@ -1133,7 +1115,6 @@ impl ToTokens for ast::Enum {
fn to_tokens(&self, into: &mut TokenStream) {
let enum_name = &self.name;
let hole = &self.hole;
let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api);
let cast_clauses = self.variants.iter().map(|variant| {
let variant_name = &variant.name;
quote! {
@ -1144,7 +1125,6 @@ impl ToTokens for ast::Enum {
});
(quote! {
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::IntoWasmAbi for #enum_name {
type Abi = u32;
@ -1155,7 +1135,6 @@ impl ToTokens for ast::Enum {
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::FromWasmAbi for #enum_name {
type Abi = u32;
@ -1168,21 +1147,18 @@ impl ToTokens for ast::Enum {
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::OptionFromWasmAbi for #enum_name {
#[inline]
fn is_none(val: &u32) -> bool { *val == #hole }
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::convert::OptionIntoWasmAbi for #enum_name {
#[inline]
fn none() -> Self::Abi { #hole }
}
#[allow(clippy::all)]
#unstable_api_attr
impl wasm_bindgen::describe::WasmDescribe for #enum_name {
fn describe() {
use wasm_bindgen::describe::*;
@ -1233,259 +1209,18 @@ impl ToTokens for ast::ImportStatic {
inner: quote! {
<#ty as WasmDescribe>::describe();
},
unstable_api: false,
attrs: vec![],
}
.to_tokens(into);
}
}
impl ToTokens for ast::Const {
fn to_tokens(&self, tokens: &mut TokenStream) {
use crate::ast::ConstValue::*;
let vis = &self.vis;
let name = &self.name;
let ty = &self.ty;
let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api);
let value: TokenStream = match self.value {
BooleanLiteral(false) => quote!(false),
BooleanLiteral(true) => quote!(true),
// the actual type is unknown because of typedefs
// so we cannot use std::fxx::INFINITY
// but we can use type inference
FloatLiteral(f) if f.is_infinite() && f.is_sign_positive() => quote!(1.0 / 0.0),
FloatLiteral(f) if f.is_infinite() && f.is_sign_negative() => quote!(-1.0 / 0.0),
FloatLiteral(f) if f.is_nan() => quote!(0.0 / 0.0),
// again no suffix
// panics on +-inf, nan
FloatLiteral(f) => {
let f = Literal::f64_suffixed(f);
quote!(#f)
}
SignedIntegerLiteral(i) => {
let i = Literal::i64_suffixed(i);
quote!(#i)
}
UnsignedIntegerLiteral(i) => {
let i = Literal::u64_suffixed(i);
quote!(#i)
}
Null => unimplemented!(),
};
let declaration = quote!(#vis const #name: #ty = #value as #ty;);
if let Some(class) = &self.class {
(quote! {
#unstable_api_attr
impl #class {
#declaration
}
})
.to_tokens(tokens);
} else {
declaration.to_tokens(tokens);
}
}
}
impl ToTokens for ast::Dictionary {
fn to_tokens(&self, tokens: &mut TokenStream) {
let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api);
let name = &self.name;
let mut methods = TokenStream::new();
for field in self.fields.iter() {
field.to_tokens(&mut methods);
}
let required_names = &self
.fields
.iter()
.filter(|f| f.required)
.map(|f| &f.rust_name)
.collect::<Vec<_>>();
let required_types = &self
.fields
.iter()
.filter(|f| f.required)
.map(|f| &f.ty)
.collect::<Vec<_>>();
let required_names2 = required_names;
let required_names3 = required_names;
let doc_comment = match &self.doc_comment {
None => "",
Some(doc_string) => doc_string,
};
let ctor = if self.ctor {
let doc_comment = match &self.ctor_doc_comment {
None => "",
Some(doc_string) => doc_string,
};
quote! {
#[doc = #doc_comment]
pub fn new(#(#required_names: #required_types),*) -> #name {
let mut _ret = #name { obj: ::js_sys::Object::new() };
#(_ret.#required_names2(#required_names3);)*
return _ret
}
}
} else {
quote! {}
};
let const_name = Ident::new(&format!("_CONST_{}", name), Span::call_site());
(quote! {
#[derive(Clone, Debug)]
#[repr(transparent)]
#[allow(clippy::all)]
#[doc = #doc_comment]
#unstable_api_attr
pub struct #name {
obj: ::js_sys::Object,
}
#[allow(clippy::all)]
#unstable_api_attr
impl #name {
#ctor
#methods
}
#[allow(bad_style)]
#[allow(clippy::all)]
#unstable_api_attr
const #const_name: () = {
use js_sys::Object;
use wasm_bindgen::describe::WasmDescribe;
use wasm_bindgen::convert::*;
use wasm_bindgen::{JsValue, JsCast};
use wasm_bindgen::__rt::core::mem::ManuallyDrop;
// interop w/ JsValue
impl From<#name> for JsValue {
#[inline]
fn from(val: #name) -> JsValue {
val.obj.into()
}
}
impl AsRef<JsValue> for #name {
#[inline]
fn as_ref(&self) -> &JsValue { self.obj.as_ref() }
}
// Boundary conversion impls
impl WasmDescribe for #name {
fn describe() {
Object::describe();
}
}
impl IntoWasmAbi for #name {
type Abi = <Object as IntoWasmAbi>::Abi;
#[inline]
fn into_abi(self) -> Self::Abi {
self.obj.into_abi()
}
}
impl<'a> IntoWasmAbi for &'a #name {
type Abi = <&'a Object as IntoWasmAbi>::Abi;
#[inline]
fn into_abi(self) -> Self::Abi {
(&self.obj).into_abi()
}
}
impl FromWasmAbi for #name {
type Abi = <Object as FromWasmAbi>::Abi;
#[inline]
unsafe fn from_abi(abi: Self::Abi) -> Self {
#name { obj: Object::from_abi(abi) }
}
}
impl OptionIntoWasmAbi for #name {
#[inline]
fn none() -> Self::Abi { Object::none() }
}
impl<'a> OptionIntoWasmAbi for &'a #name {
#[inline]
fn none() -> Self::Abi { <&'a Object>::none() }
}
impl OptionFromWasmAbi for #name {
#[inline]
fn is_none(abi: &Self::Abi) -> bool { Object::is_none(abi) }
}
impl RefFromWasmAbi for #name {
type Abi = <Object as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<#name>;
#[inline]
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor {
let tmp = <Object as RefFromWasmAbi>::ref_from_abi(js);
ManuallyDrop::new(#name {
obj: ManuallyDrop::into_inner(tmp),
})
}
}
impl JsCast for #name {
#[inline]
fn instanceof(val: &JsValue) -> bool {
Object::instanceof(val)
}
#[inline]
fn unchecked_from_js(val: JsValue) -> Self {
#name { obj: Object::unchecked_from_js(val) }
}
#[inline]
fn unchecked_from_js_ref(val: &JsValue) -> &Self {
unsafe { &*(val as *const JsValue as *const #name) }
}
}
};
})
.to_tokens(tokens);
}
}
impl ToTokens for ast::DictionaryField {
fn to_tokens(&self, tokens: &mut TokenStream) {
let rust_name = &self.rust_name;
let js_name = &self.js_name;
let ty = &self.ty;
let doc_comment = match &self.doc_comment {
None => "",
Some(doc_string) => doc_string,
};
(quote! {
#[allow(clippy::all)]
#[doc = #doc_comment]
pub fn #rust_name(&mut self, val: #ty) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.obj.as_ref(),
&JsValue::from(#js_name),
&JsValue::from(val),
);
debug_assert!(r.is_ok(), "setting properties should never fail on our dictionary objects");
let _ = r;
self
}
}).to_tokens(tokens);
}
}
/// Emits the necessary glue tokens for "descriptor", generating an appropriate
/// symbol name as well as attributes around the descriptor function itself.
struct Descriptor<'a, T> {
ident: &'a Ident,
inner: T,
unstable_api: bool,
attrs: Vec<syn::Attribute>,
}
impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> {
@ -1513,15 +1248,15 @@ impl<'a, T: ToTokens> ToTokens for Descriptor<'a, T> {
}
let name = Ident::new(&format!("__wbindgen_describe_{}", ident), ident.span());
let unstable_api_attr = util::maybe_unstable_api_attr(self.unstable_api);
let inner = &self.inner;
let attrs = &self.attrs;
(quote! {
#(#attrs)*
#[no_mangle]
#[allow(non_snake_case)]
#[doc(hidden)]
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
#[allow(clippy::all)]
#unstable_api_attr
pub extern "C" fn #name() {
use wasm_bindgen::describe::*;
// See definition of `link_mem_intrinsics` for what this is doing

View File

@ -1,403 +0,0 @@
use crate::ast;
use proc_macro2::Ident;
use syn;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ImportedTypeKind {
/// The definition of an imported type.
Definition,
/// A reference to an imported type.
Reference,
}
impl<T> ImportedTypes for Option<T>
where
T: ImportedTypes,
{
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
if let Some(inner) = self {
inner.imported_types(f);
}
}
}
/// Iterate over definitions of and references to imported types in the AST.
pub trait ImportedTypes {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind);
}
/// Iterate over definitions of imported types in the AST.
pub trait ImportedTypeDefinitions {
fn imported_type_definitions<F>(&self, f: &mut F)
where
F: FnMut(&Ident);
}
impl<T> ImportedTypeDefinitions for T
where
T: ImportedTypes,
{
fn imported_type_definitions<F>(&self, f: &mut F)
where
F: FnMut(&Ident),
{
self.imported_types(&mut |id, kind| {
if let ImportedTypeKind::Definition = kind {
f(id);
}
});
}
}
/// Iterate over references to imported types in the AST.
pub trait ImportedTypeReferences {
fn imported_type_references<F>(&self, f: &mut F)
where
F: FnMut(&Ident);
}
impl<T> ImportedTypeReferences for T
where
T: ImportedTypes,
{
fn imported_type_references<F>(&self, f: &mut F)
where
F: FnMut(&Ident),
{
self.imported_types(&mut |id, kind| {
if let ImportedTypeKind::Reference = kind {
f(id);
}
});
}
}
impl<'a, T: ImportedTypes> ImportedTypes for &'a T {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
(*self).imported_types(f)
}
}
impl ImportedTypes for ast::Program {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.imports.imported_types(f);
self.consts.imported_types(f);
self.dictionaries.imported_types(f);
}
}
impl<T> ImportedTypes for Vec<T>
where
T: ImportedTypes,
{
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
for x in self {
x.imported_types(f);
}
}
}
impl ImportedTypes for ast::Import {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.kind.imported_types(f)
}
}
impl ImportedTypes for ast::ImportKind {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
match self {
ast::ImportKind::Static(s) => s.imported_types(f),
ast::ImportKind::Function(fun) => fun.imported_types(f),
ast::ImportKind::Type(ty) => ty.imported_types(f),
ast::ImportKind::Enum(enm) => enm.imported_types(f),
}
}
}
impl ImportedTypes for ast::ImportStatic {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.ty.imported_types(f);
}
}
impl ImportedTypes for syn::Type {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
match self {
syn::Type::Reference(ref r) => r.imported_types(f),
syn::Type::Path(ref p) => p.imported_types(f),
_ => {}
}
}
}
impl ImportedTypes for syn::TypeReference {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.elem.imported_types(f);
}
}
impl ImportedTypes for syn::TypePath {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.qself.imported_types(f);
self.path.imported_types(f);
}
}
impl ImportedTypes for syn::QSelf {
fn imported_types<F>(&self, _: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
// TODO
}
}
impl ImportedTypes for syn::Path {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
for seg in self.segments.iter() {
seg.arguments.imported_types(f);
}
f(
&self.segments.last().unwrap().ident,
ImportedTypeKind::Reference,
);
}
}
impl ImportedTypes for syn::PathArguments {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
match self {
syn::PathArguments::AngleBracketed(data) => {
for arg in data.args.iter() {
arg.imported_types(f);
}
}
//TOCHECK
syn::PathArguments::Parenthesized(data) => {
for input in data.inputs.iter() {
input.imported_types(f);
}
// TODO do we need to handle output here?
// https://docs.rs/syn/0.14.0/syn/struct.ParenthesizedGenericArguments.html
}
syn::PathArguments::None => {}
}
}
}
impl ImportedTypes for syn::GenericArgument {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
match self {
syn::GenericArgument::Lifetime(_) => {}
syn::GenericArgument::Type(ty) => ty.imported_types(f),
syn::GenericArgument::Binding(_) => {} // TODO
syn::GenericArgument::Const(_) => {} // TODO
syn::GenericArgument::Constraint(_) => {} // TODO
}
}
}
impl ImportedTypes for ast::ImportFunction {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.function.imported_types(f);
self.kind.imported_types(f);
}
}
impl ImportedTypes for ast::ImportFunctionKind {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
match self {
ast::ImportFunctionKind::Method { ty, .. } => ty.imported_types(f),
ast::ImportFunctionKind::Normal => {}
}
}
}
impl ImportedTypes for ast::Function {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.arguments.imported_types(f);
if let Some(ref r) = self.ret {
r.imported_types(f);
}
}
}
impl ImportedTypes for syn::FnArg {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
match self {
syn::FnArg::Receiver(_) => {}
syn::FnArg::Typed(p) => p.imported_types(f),
}
}
}
impl ImportedTypes for syn::PatType {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.ty.imported_types(f)
}
}
impl ImportedTypes for ast::ImportType {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
f(&self.rust_name, ImportedTypeKind::Definition);
for class in self.extends.iter() {
class.imported_types(f);
}
}
}
impl ImportedTypes for ast::ImportEnum {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
f(&self.name, ImportedTypeKind::Definition);
}
}
impl ImportedTypes for ast::Const {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.ty.imported_types(f);
}
}
impl ImportedTypes for ast::Dictionary {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
f(&self.name, ImportedTypeKind::Definition);
for field in self.fields.iter() {
field.imported_types(f);
}
}
}
impl ImportedTypes for ast::DictionaryField {
fn imported_types<F>(&self, f: &mut F)
where
F: FnMut(&Ident, ImportedTypeKind),
{
self.ty.imported_types(f);
}
}
/// Remove any methods, statics, &c, that reference types that are *not*
/// defined.
pub trait RemoveUndefinedImports {
fn remove_undefined_imports<F>(&mut self, is_defined: &F) -> bool
where
F: Fn(&Ident) -> bool;
}
impl RemoveUndefinedImports for ast::Program {
fn remove_undefined_imports<F>(&mut self, is_defined: &F) -> bool
where
F: Fn(&Ident) -> bool,
{
let mut changed = self.imports.remove_undefined_imports(is_defined);
changed = self.consts.remove_undefined_imports(is_defined) || changed;
for dictionary in self.dictionaries.iter_mut() {
let num_required =
|dict: &ast::Dictionary| dict.fields.iter().filter(|f| f.required).count();
let before = num_required(dictionary);
changed = dictionary.fields.remove_undefined_imports(is_defined) || changed;
// If a required field was removed we can no longer construct this
// dictionary so disable the constructor.
if before != num_required(dictionary) {
dictionary.ctor = false;
}
}
changed
}
}
impl<T> RemoveUndefinedImports for Vec<T>
where
T: ImportedTypeReferences,
{
fn remove_undefined_imports<F>(&mut self, is_defined: &F) -> bool
where
F: Fn(&Ident) -> bool,
{
let before = self.len();
self.retain(|x| {
let mut all_defined = true;
x.imported_type_references(&mut |id| {
if all_defined {
if !is_defined(id) {
log::info!("removing due to {} not being defined", id);
all_defined = false;
}
}
});
all_defined
});
before != self.len()
}
}

View File

@ -188,7 +188,6 @@ fn shared_export<'a>(
function: shared_function(&export.function, intern),
method_kind,
start: export.start,
unstable_api: export.unstable_api,
})
}

View File

@ -10,6 +10,5 @@ mod error;
pub mod ast;
mod codegen;
pub mod defined;
mod encode;
pub mod util;

View File

@ -113,12 +113,10 @@ pub fn ident_ty(ident: Ident) -> syn::Type {
}
pub fn wrap_import_function(function: ast::ImportFunction) -> ast::Import {
let unstable_api = function.unstable_api;
ast::Import {
module: ast::ImportModule::None,
js_namespace: None,
kind: ast::ImportKind::Function(function),
unstable_api,
}
}
@ -156,19 +154,3 @@ impl<T: Hash> fmt::Display for ShortHash<T> {
write!(f, "{:016x}", h.finish())
}
}
/// Create syn attribute for `#[cfg(web_sys_unstable_apis)]` and a doc comment.
pub fn unstable_api_attrs() -> proc_macro2::TokenStream {
quote::quote!(
#[cfg(web_sys_unstable_apis)]
#[doc = "\n\n*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as [described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
)
}
pub fn maybe_unstable_api_attr(unstable_api: bool) -> Option<proc_macro2::TokenStream> {
if unstable_api {
Some(unstable_api_attrs())
} else {
None
}
}

View File

@ -4,7 +4,7 @@ use crate::wit::{Adapter, AdapterId, AdapterJsImportKind, AuxValue};
use crate::wit::{AdapterKind, Instruction, InstructionData};
use crate::wit::{AuxEnum, AuxExport, AuxExportKind, AuxImport, AuxStruct};
use crate::wit::{JsImport, JsImportName, NonstandardWitSection, WasmBindgenAux};
use crate::{Bindgen, EncodeInto, OutputMode};
use crate::{reset_indentation, Bindgen, EncodeInto, OutputMode, PLACEHOLDER_MODULE};
use anyhow::{anyhow, bail, Context as _, Error};
use std::borrow::Cow;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
@ -188,6 +188,85 @@ impl<'a> Context<'a> {
self.finalize_js(module_name, needs_manual_start)
}
fn generate_node_imports(&self) -> String {
let mut imports = BTreeSet::new();
for import in self.module.imports.iter() {
imports.insert(&import.module);
}
let mut shim = String::new();
shim.push_str("let imports = {};\n");
if self.config.mode.nodejs_experimental_modules() {
for (i, module) in imports.iter().enumerate() {
if module.as_str() != PLACEHOLDER_MODULE {
shim.push_str(&format!("import * as import{} from '{}';\n", i, module));
}
}
}
for (i, module) in imports.iter().enumerate() {
if module.as_str() == PLACEHOLDER_MODULE {
shim.push_str(&format!(
"imports['{0}'] = module.exports;\n",
PLACEHOLDER_MODULE
));
} else {
if self.config.mode.nodejs_experimental_modules() {
shim.push_str(&format!("imports['{}'] = import{};\n", module, i));
} else {
shim.push_str(&format!("imports['{0}'] = require('{0}');\n", module));
}
}
}
reset_indentation(&shim)
}
fn generate_node_wasm_loading(&self, path: &Path) -> String {
let mut shim = String::new();
if self.config.mode.nodejs_experimental_modules() {
// On windows skip the leading `/` which comes out when we parse a
// url to use `C:\...` instead of `\C:\...`
shim.push_str(&format!(
"
import * as path from 'path';
import * as fs from 'fs';
import * as url from 'url';
import * as process from 'process';
let file = path.dirname(url.parse(import.meta.url).pathname);
if (process.platform === 'win32') {{
file = file.substring(1);
}}
const bytes = fs.readFileSync(path.join(file, '{}'));
",
path.file_name().unwrap().to_str().unwrap()
));
} else {
shim.push_str(&format!(
"
const path = require('path').join(__dirname, '{}');
const bytes = require('fs').readFileSync(path);
",
path.file_name().unwrap().to_str().unwrap()
));
}
shim.push_str(
"
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
wasm = wasmInstance.exports;
module.exports.__wasm = wasm;
",
);
reset_indentation(&shim)
}
/// Performs the task of actually generating the final JS module, be it
/// `--target no-modules`, `--target web`, or for bundlers. This is the very
/// last step performed in `finalize`.
@ -224,11 +303,12 @@ impl<'a> Context<'a> {
OutputMode::Node {
experimental_modules: false,
} => {
js.push_str(&self.generate_node_imports());
js.push_str("let wasm;\n");
for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) {
let import = self.module.imports.get_mut(*id);
import.module = format!("./{}.js", module_name);
footer.push_str("\nmodule.exports.");
footer.push_str(&import.name);
footer.push_str(" = ");
@ -236,7 +316,13 @@ impl<'a> Context<'a> {
footer.push_str(";\n");
}
footer.push_str(&format!("wasm = require('./{}_bg');\n", module_name));
footer.push_str(
&self.generate_node_wasm_loading(&Path::new(&format!(
"./{}_bg.wasm",
module_name
))),
);
if needs_manual_start {
footer.push_str("wasm.__wbindgen_start();\n");
}

View File

@ -1,7 +1,7 @@
#![doc(html_root_url = "https://docs.rs/wasm-bindgen-cli-support/0.2")]
use anyhow::{bail, Context, Error};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::env;
use std::fs;
use std::mem;
@ -9,6 +9,8 @@ use std::path::{Path, PathBuf};
use std::str;
use walrus::Module;
pub(crate) const PLACEHOLDER_MODULE: &str = "__wbindgen_placeholder__";
mod anyref;
mod decode;
mod descriptor;
@ -667,13 +669,6 @@ impl Output {
.with_context(|| format!("failed to write `{}`", ts_path.display()))?;
}
if gen.mode.nodejs() {
let js_path = wasm_path.with_extension(extension);
let shim = gen.generate_node_wasm_import(&self.module, &wasm_path);
fs::write(&js_path, shim)
.with_context(|| format!("failed to write `{}`", js_path.display()))?;
}
if gen.typescript {
let ts_path = wasm_path.with_extension("d.ts");
let ts = wasm2es6js::typescript(&self.module)?;
@ -685,77 +680,6 @@ impl Output {
}
}
impl JsGenerated {
fn generate_node_wasm_import(&self, m: &Module, path: &Path) -> String {
let mut imports = BTreeSet::new();
for import in m.imports.iter() {
imports.insert(&import.module);
}
let mut shim = String::new();
if self.mode.nodejs_experimental_modules() {
for (i, module) in imports.iter().enumerate() {
shim.push_str(&format!("import * as import{} from '{}';\n", i, module));
}
// On windows skip the leading `/` which comes out when we parse a
// url to use `C:\...` instead of `\C:\...`
shim.push_str(&format!(
"
import * as path from 'path';
import * as fs from 'fs';
import * as url from 'url';
import * as process from 'process';
let file = path.dirname(url.parse(import.meta.url).pathname);
if (process.platform === 'win32') {{
file = file.substring(1);
}}
const bytes = fs.readFileSync(path.join(file, '{}'));
",
path.file_name().unwrap().to_str().unwrap()
));
} else {
shim.push_str(&format!(
"
const path = require('path').join(__dirname, '{}');
const bytes = require('fs').readFileSync(path);
",
path.file_name().unwrap().to_str().unwrap()
));
}
shim.push_str("let imports = {};\n");
for (i, module) in imports.iter().enumerate() {
if self.mode.nodejs_experimental_modules() {
shim.push_str(&format!("imports['{}'] = import{};\n", module, i));
} else {
shim.push_str(&format!("imports['{0}'] = require('{0}');\n", module));
}
}
shim.push_str(&format!(
"
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
",
));
if self.mode.nodejs_experimental_modules() {
for entry in m.exports.iter() {
shim.push_str("export const ");
shim.push_str(&entry.name);
shim.push_str(" = wasmInstance.exports.");
shim.push_str(&entry.name);
shim.push_str(";\n");
}
} else {
shim.push_str("module.exports = wasmInstance.exports;\n");
}
reset_indentation(&shim)
}
}
fn gc_module_and_adapters(module: &mut Module) {
loop {
// Fist up, cleanup the native wasm module. Note that roots can come

View File

@ -1,7 +1,7 @@
use crate::decode;
use crate::descriptor::{Descriptor, Function};
use crate::descriptors::WasmBindgenDescriptorsSection;
use crate::intrinsic::Intrinsic;
use crate::{decode, PLACEHOLDER_MODULE};
use anyhow::{anyhow, bail, Error};
use std::collections::{HashMap, HashSet};
use std::str;
@ -9,8 +9,6 @@ use walrus::MemoryId;
use walrus::{ExportId, FunctionId, ImportId, Module};
use wasm_bindgen_shared::struct_function_export_name;
const PLACEHOLDER_MODULE: &str = "__wbindgen_placeholder__";
mod incoming;
mod nonstandard;
mod outgoing;

View File

@ -41,15 +41,14 @@ pub fn execute(
global.__wbg_test_invoke = f => f();
async function main(tests) {{
const support = require("./{0}");
const wasm = require("./{0}_bg");
const wasm = require("./{0}");
cx = new support.WasmBindgenTestContext();
handlers.on_console_debug = support.__wbgtest_console_debug;
handlers.on_console_log = support.__wbgtest_console_log;
handlers.on_console_info = support.__wbgtest_console_info;
handlers.on_console_warn = support.__wbgtest_console_warn;
handlers.on_console_error = support.__wbgtest_console_error;
cx = new wasm.WasmBindgenTestContext();
handlers.on_console_debug = wasm.__wbgtest_console_debug;
handlers.on_console_log = wasm.__wbgtest_console_log;
handlers.on_console_info = wasm.__wbgtest_console_info;
handlers.on_console_warn = wasm.__wbgtest_console_warn;
handlers.on_console_error = wasm.__wbgtest_console_error;
// Forward runtime arguments. These arguments are also arguments to the
// `wasm-bindgen-test-runner` which forwards them to node which we
@ -57,7 +56,7 @@ pub fn execute(
// filters for now.
cx.args(process.argv.slice(2));
const ok = await cx.run(tests.map(n => wasm[n]));
const ok = await cx.run(tests.map(n => wasm.__wasm[n]));
if (!ok)
exit(1);
}}

View File

@ -22,7 +22,6 @@ struct AttributeParseState {
pub struct BindgenAttrs {
/// List of parsed attributes
pub attrs: Vec<(Cell<bool>, BindgenAttr)>,
pub unstable_api_attr: Option<syn::Attribute>,
}
macro_rules! attrgen {
@ -54,6 +53,7 @@ macro_rules! attrgen {
(typescript_custom_section, TypescriptCustomSection(Span)),
(start, Start(Span)),
(skip, Skip(Span)),
(typescript_type, TypeScriptType(Span, String, Span)),
// For testing purposes only.
(assert_no_shim, AssertNoShim(Span)),
@ -187,10 +187,7 @@ impl Default for BindgenAttrs {
// sanity check that we call `check_used` an appropriate number of
// times.
ATTRS.with(|state| state.parsed.set(state.parsed.get() + 1));
BindgenAttrs {
attrs: Vec::new(),
unstable_api_attr: None,
}
BindgenAttrs { attrs: Vec::new() }
}
}
@ -357,7 +354,6 @@ impl<'a> ConvertToAst<BindgenAttrs> for &'a mut syn::ItemStruct {
getter: Ident::new(&getter, Span::call_site()),
setter: Ident::new(&setter, Span::call_site()),
comments,
unstable_api: false,
});
attrs.check_used()?;
}
@ -518,7 +514,6 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
rust_name: self.sig.ident.clone(),
shim: Ident::new(&shim, Span::call_site()),
doc_comment: None,
unstable_api: false,
});
opts.check_used()?;
@ -535,6 +530,7 @@ impl ConvertToAst<BindgenAttrs> for syn::ForeignItemType {
.js_name()
.map(|s| s.0)
.map_or_else(|| self.ident.to_string(), |s| s.to_string());
let typescript_type = attrs.typescript_type().map(|s| s.0.to_string());
let is_type_of = attrs.is_type_of().cloned();
let shim = format!("__wbg_instanceof_{}_{}", self.ident, ShortHash(&self.ident));
let mut extends = Vec::new();
@ -556,12 +552,11 @@ impl ConvertToAst<BindgenAttrs> for syn::ForeignItemType {
Ok(ast::ImportKind::Type(ast::ImportType {
vis: self.vis,
attrs: self.attrs,
unstable_api: false,
doc_comment: None,
instanceof_shim: shim,
is_type_of,
rust_name: self.ident,
typescript_name: None,
typescript_type,
js_name,
extends,
vendor_prefixes,
@ -784,7 +779,6 @@ impl<'a> MacroParse<(Option<BindgenAttrs>, &'a mut TokenStream)> for syn::Item {
rust_class: None,
rust_name,
start,
unstable_api: false,
});
}
syn::Item::Struct(mut s) => {
@ -808,8 +802,7 @@ impl<'a> MacroParse<(Option<BindgenAttrs>, &'a mut TokenStream)> for syn::Item {
if let Some(opts) = opts {
opts.check_used()?;
}
e.to_tokens(tokens);
e.macro_parse(program, ())?;
e.macro_parse(program, (tokens,))?;
}
syn::Item::Const(mut c) => {
let opts = match opts {
@ -862,7 +855,7 @@ impl<'a> MacroParse<BindgenAttrs> for &'a mut syn::ItemImpl {
syn::Type::Path(syn::TypePath {
qself: None,
ref path,
}) => extract_path_ident(path)?,
}) => path,
_ => bail_span!(
self.self_ty,
"unsupported self type in #[wasm_bindgen] impl"
@ -890,7 +883,7 @@ impl<'a> MacroParse<BindgenAttrs> for &'a mut syn::ItemImpl {
// then go for the rest.
fn prepare_for_impl_recursion(
item: &mut syn::ImplItem,
class: &Ident,
class: &syn::Path,
impl_opts: &BindgenAttrs,
) -> Result<(), Diagnostic> {
let method = match item {
@ -916,10 +909,12 @@ fn prepare_for_impl_recursion(
other => bail_span!(other, "failed to parse this item as a known item"),
};
let ident = extract_path_ident(class)?;
let js_class = impl_opts
.js_class()
.map(|s| s.0.to_string())
.unwrap_or(class.to_string());
.unwrap_or(ident.to_string());
method.attrs.insert(
0,
@ -985,26 +980,89 @@ impl<'a, 'b> MacroParse<(&'a Ident, &'a str)> for &'b mut syn::ImplItemMethod {
rust_class: Some(class.clone()),
rust_name: self.sig.ident.clone(),
start: false,
unstable_api: false,
});
opts.check_used()?;
Ok(())
}
}
impl MacroParse<()> for syn::ItemEnum {
fn macro_parse(self, program: &mut ast::Program, (): ()) -> Result<(), Diagnostic> {
match self.vis {
syn::Visibility::Public(_) => {}
_ => bail_span!(self, "only public enums are allowed with #[wasm_bindgen]"),
fn import_enum(enum_: syn::ItemEnum, program: &mut ast::Program) -> Result<(), Diagnostic> {
let mut variants = vec![];
let mut variant_values = vec![];
for v in enum_.variants.iter() {
match v.fields {
syn::Fields::Unit => (),
_ => bail_span!(v.fields, "only C-Style enums allowed with #[wasm_bindgen]"),
}
match &v.discriminant {
Some((
_,
syn::Expr::Lit(syn::ExprLit {
attrs: _,
lit: syn::Lit::Str(str_lit),
}),
)) => {
variants.push(v.ident.clone());
variant_values.push(str_lit.value());
}
Some((_, expr)) => bail_span!(
expr,
"enums with #[wasm_bidngen] cannot mix string and non-string values",
),
None => {
bail_span!(v, "all variants must have a value");
}
}
}
program.imports.push(ast::Import {
module: ast::ImportModule::None,
js_namespace: None,
kind: ast::ImportKind::Enum(ast::ImportEnum {
vis: enum_.vis,
name: enum_.ident,
variants,
variant_values,
rust_attrs: enum_.attrs,
}),
});
Ok(())
}
impl<'a> MacroParse<(&'a mut TokenStream,)> for syn::ItemEnum {
fn macro_parse(
self,
program: &mut ast::Program,
(tokens,): (&'a mut TokenStream,),
) -> Result<(), Diagnostic> {
if self.variants.len() == 0 {
bail_span!(self, "cannot export empty enums to JS");
}
// Check if the first value is a string literal
match self.variants[0].discriminant {
Some((
_,
syn::Expr::Lit(syn::ExprLit {
attrs: _,
lit: syn::Lit::Str(_),
}),
)) => {
return import_enum(self, program);
}
_ => {}
}
let has_discriminant = self.variants[0].discriminant.is_some();
match self.vis {
syn::Visibility::Public(_) => {}
_ => bail_span!(self, "only public enums are allowed with #[wasm_bindgen]"),
}
let variants = self
.variants
.iter()
@ -1075,13 +1133,16 @@ impl MacroParse<()> for syn::ItemEnum {
}
let comments = extract_doc_comments(&self.attrs);
self.to_tokens(tokens);
program.enums.push(ast::Enum {
name: self.ident,
variants,
comments,
hole,
unstable_api: false,
});
Ok(())
}
}
@ -1185,7 +1246,6 @@ impl MacroParse<ast::ImportModule> for syn::ForeignItem {
module,
js_namespace,
kind,
unstable_api: false,
});
Ok(())
@ -1290,20 +1350,21 @@ fn assert_not_variadic(attrs: &BindgenAttrs) -> Result<(), Diagnostic> {
Ok(())
}
/// If the path is a single ident, return it.
/// Extracts the last ident from the path
fn extract_path_ident(path: &syn::Path) -> Result<Ident, Diagnostic> {
if path.leading_colon.is_some() {
bail_span!(path, "global paths are not supported yet");
for segment in path.segments.iter() {
match segment.arguments {
syn::PathArguments::None => {}
_ => bail_span!(path, "paths with type parameters are not supported yet"),
}
}
if path.segments.len() != 1 {
bail_span!(path, "multi-segment paths are not supported yet");
match path.segments.last() {
Some(value) => Ok(value.ident.clone()),
None => {
bail_span!(path, "empty idents are not supported");
}
}
let value = &path.segments[0];
match value.arguments {
syn::PathArguments::None => {}
_ => bail_span!(path, "paths with type parameters are not supported yet"),
}
Ok(value.ident.clone())
}
pub fn reset_attrs_used() {

View File

@ -1,4 +1,4 @@
error: only public enums are allowed with #[wasm_bindgen]
error: cannot export empty enums to JS
--> $DIR/invalid-enums.rs:4:1
|
4 | enum A {}

View File

@ -22,18 +22,6 @@ error: first argument of method must be a path
14 | fn f3(x: &&u32);
| ^^^^^
error: multi-segment paths are not supported yet
--> $DIR/invalid-imports.rs:16:15
|
16 | fn f4(x: &foo::Bar);
| ^^^^^^^^
error: global paths are not supported yet
--> $DIR/invalid-imports.rs:18:15
|
18 | fn f4(x: &::Bar);
| ^^^^^
error: paths with type parameters are not supported yet
--> $DIR/invalid-imports.rs:20:15
|
@ -52,12 +40,6 @@ error: constructor returns must be bare types
25 | fn f();
| ^^^^^^^
error: global paths are not supported yet
--> $DIR/invalid-imports.rs:27:15
|
27 | fn f() -> ::Bar;
| ^^^^^
error: return value of constructor must be a bare path
--> $DIR/invalid-imports.rs:29:5
|

View File

@ -94,7 +94,6 @@ macro_rules! shared_api {
function: Function<'a>,
method_kind: MethodKind<'a>,
start: bool,
unstable_api: bool,
}
struct Enum<'a> {

1
crates/web-sys/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/features

File diff suppressed because it is too large Load Diff

View File

@ -1,111 +0,0 @@
use anyhow::{Context, Result};
use sourcefile::SourceFile;
use std::collections::HashSet;
use std::env;
use std::ffi::OsStr;
use std::fs;
use std::path::{self, PathBuf};
use std::process::Command;
/// Read all WebIDL files in a directory into a single `SourceFile`
fn read_source_from_path(dir: &str) -> Result<SourceFile> {
let entries = fs::read_dir(dir).context("reading webidls/enabled directory")?;
let mut source = SourceFile::default();
for entry in entries {
let entry = entry.context(format!("getting {}/*.webidl entry", dir))?;
let path = entry.path();
if path.extension() != Some(OsStr::new("webidl")) {
continue;
}
println!("cargo:rerun-if-changed={}", path.display());
source = source
.add_file(&path)
.with_context(|| format!("reading contents of file \"{}\"", path.display()))?;
}
Ok(source)
}
fn main() -> Result<()> {
#[cfg(feature = "env_logger")]
env_logger::init();
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=webidls/enabled");
println!("cargo:rerun-if-changed=webidls/unstable");
// Read our manifest, learn all `[feature]` directives with "toml parsing".
// Use all these names to match against environment variables set by Cargo
// to figure out which features are activated to we can pass that down to
// the webidl compiler.
let manifest_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let manifest = fs::read_to_string(manifest_dir.join("Cargo.toml"))?;
let features = manifest
.lines()
.skip_while(|f| !f.starts_with("[features]"));
let enabled_features = env::vars()
.map(|p| p.0)
.filter(|p| p.starts_with("CARGO_FEATURE_"))
.map(|mut p| {
p.drain(0.."CARGO_FEATURE_".len());
p
})
.collect::<HashSet<_>>();
let mut allowed = Vec::new();
for feature in features.filter(|f| !f.starts_with("#") && !f.starts_with("[")) {
let mut parts = feature.split('=');
let name = parts.next().unwrap().trim();
if enabled_features.contains(&name.to_uppercase()) {
allowed.push(name);
}
}
// If we're printing all features don't filter anything
println!("cargo:rerun-if-env-changed=__WASM_BINDGEN_DUMP_FEATURES");
let allowed = if env::var("__WASM_BINDGEN_DUMP_FEATURES").is_ok() {
None
} else {
Some(&allowed[..])
};
let source = read_source_from_path("webidls/enabled")?;
let unstable_source = read_source_from_path("webidls/unstable")?;
let bindings =
match wasm_bindgen_webidl::compile(&source.contents, &unstable_source.contents, allowed) {
Ok(bindings) => bindings,
Err(e) => {
if let Some(err) = e.downcast_ref::<wasm_bindgen_webidl::WebIDLParseError>() {
if let Some(pos) = source.resolve_offset(err.0) {
let ctx = format!(
"compiling WebIDL into wasm-bindgen bindings in file \
\"{}\", line {} column {}",
pos.filename,
pos.line + 1,
pos.col + 1
);
return Err(e.context(ctx));
} else {
return Err(e.context("compiling WebIDL into wasm-bindgen bindings"));
}
}
return Err(e.context("compiling WebIDL into wasm-bindgen bindings"));
}
};
let out_dir = env::var("OUT_DIR").context("reading OUT_DIR environment variable")?;
let out_file_path = path::Path::new(&out_dir).join("bindings.rs");
fs::write(&out_file_path, bindings).context("writing bindings to output file")?;
println!("cargo:rustc-env=BINDINGS={}", out_file_path.display());
// run rustfmt on the generated file - really handy for debugging
//
// This is opportunistic though so don't assert that it succeeds.
println!("cargo:rerun-if-env-changed=WEBIDL_RUSTFMT_BINDINGS");
if env::var("WEBIDL_RUSTFMT_BINDINGS").ok() != Some("0".to_string()) {
drop(Command::new("rustfmt").arg(&out_file_path).status());
}
Ok(())
}

View File

@ -0,0 +1,36 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AbortController , typescript_type = "AbortController" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AbortController` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortController`*"]
pub type AbortController;
#[cfg(feature = "AbortSignal")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AbortController" , js_name = signal ) ]
#[doc = "Getter for the `signal` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/signal)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortController`, `AbortSignal`*"]
pub fn signal(this: &AbortController) -> AbortSignal;
#[wasm_bindgen(catch, constructor, js_class = "AbortController")]
#[doc = "The `new AbortController(..)` constructor, creating a new instance of `AbortController`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/AbortController)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortController`*"]
pub fn new() -> Result<AbortController, JsValue>;
# [ wasm_bindgen ( method , structural , js_class = "AbortController" , js_name = abort ) ]
#[doc = "The `abort()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortController`*"]
pub fn abort(this: &AbortController);
}

View File

@ -0,0 +1,35 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = AbortSignal , typescript_type = "AbortSignal" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AbortSignal` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
pub type AbortSignal;
# [ wasm_bindgen ( structural , method , getter , js_class = "AbortSignal" , js_name = aborted ) ]
#[doc = "Getter for the `aborted` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/aborted)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
pub fn aborted(this: &AbortSignal) -> bool;
# [ wasm_bindgen ( structural , method , getter , js_class = "AbortSignal" , js_name = onabort ) ]
#[doc = "Getter for the `onabort` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/onabort)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
pub fn onabort(this: &AbortSignal) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "AbortSignal" , js_name = onabort ) ]
#[doc = "Setter for the `onabort` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/onabort)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
pub fn set_onabort(this: &AbortSignal, value: Option<&::js_sys::Function>);
}

View File

@ -0,0 +1,69 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AddEventListenerOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AddEventListenerOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub type AddEventListenerOptions;
}
impl AddEventListenerOptions {
#[doc = "Construct a new `AddEventListenerOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `capture` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub fn capture(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("capture"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `once` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub fn once(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("once"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `passive` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AddEventListenerOptions`*"]
pub fn passive(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("passive"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,50 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AesCbcParams ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AesCbcParams` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
pub type AesCbcParams;
}
impl AesCbcParams {
#[doc = "Construct a new `AesCbcParams`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
pub fn new(name: &str, iv: &::js_sys::Object) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret.iv(iv);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCbcParams`*"]
pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("iv"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,69 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AesCtrParams ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AesCtrParams` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub type AesCtrParams;
}
impl AesCtrParams {
#[doc = "Construct a new `AesCtrParams`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub fn new(name: &str, counter: &::js_sys::Object, length: u8) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret.counter(counter);
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `counter` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub fn counter(&mut self, val: &::js_sys::Object) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("counter"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
pub fn length(&mut self, val: u8) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,51 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AesDerivedKeyParams ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AesDerivedKeyParams` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
pub type AesDerivedKeyParams;
}
impl AesDerivedKeyParams {
#[doc = "Construct a new `AesDerivedKeyParams`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
pub fn new(name: &str, length: u32) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesDerivedKeyParams`*"]
pub fn length(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,84 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AesGcmParams ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AesGcmParams` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub type AesGcmParams;
}
impl AesGcmParams {
#[doc = "Construct a new `AesGcmParams`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn new(name: &str, iv: &::js_sys::Object) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret.iv(iv);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `additionalData` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn additional_data(&mut self, val: &::js_sys::Object) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("additionalData"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `iv` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn iv(&mut self, val: &::js_sys::Object) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("iv"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `tagLength` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesGcmParams`*"]
pub fn tag_length(&mut self, val: u8) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("tagLength"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,51 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AesKeyAlgorithm ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AesKeyAlgorithm` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
pub type AesKeyAlgorithm;
}
impl AesKeyAlgorithm {
#[doc = "Construct a new `AesKeyAlgorithm`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
pub fn new(name: &str, length: u16) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyAlgorithm`*"]
pub fn length(&mut self, val: u16) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,51 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AesKeyGenParams ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AesKeyGenParams` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
pub type AesKeyGenParams;
}
impl AesKeyGenParams {
#[doc = "Construct a new `AesKeyGenParams`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
pub fn new(name: &str, length: u16) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret.length(length);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AesKeyGenParams`*"]
pub fn length(&mut self, val: u16) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,36 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = Algorithm ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `Algorithm` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
pub type Algorithm;
}
impl Algorithm {
#[doc = "Construct a new `Algorithm`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
pub fn new(name: &str) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Algorithm`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,14 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AlignSetting` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AlignSetting`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AlignSetting {
Start = "start",
Center = "center",
End = "end",
Left = "left",
Right = "right",
}

View File

@ -0,0 +1,124 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = AnalyserNode , typescript_type = "AnalyserNode" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnalyserNode` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub type AnalyserNode;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnalyserNode" , js_name = fftSize ) ]
#[doc = "Getter for the `fftSize` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn fft_size(this: &AnalyserNode) -> u32;
# [ wasm_bindgen ( structural , method , setter , js_class = "AnalyserNode" , js_name = fftSize ) ]
#[doc = "Setter for the `fftSize` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn set_fft_size(this: &AnalyserNode, value: u32);
# [ wasm_bindgen ( structural , method , getter , js_class = "AnalyserNode" , js_name = frequencyBinCount ) ]
#[doc = "Getter for the `frequencyBinCount` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/frequencyBinCount)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn frequency_bin_count(this: &AnalyserNode) -> u32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnalyserNode" , js_name = minDecibels ) ]
#[doc = "Getter for the `minDecibels` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/minDecibels)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn min_decibels(this: &AnalyserNode) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "AnalyserNode" , js_name = minDecibels ) ]
#[doc = "Setter for the `minDecibels` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/minDecibels)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn set_min_decibels(this: &AnalyserNode, value: f64);
# [ wasm_bindgen ( structural , method , getter , js_class = "AnalyserNode" , js_name = maxDecibels ) ]
#[doc = "Getter for the `maxDecibels` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/maxDecibels)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn max_decibels(this: &AnalyserNode) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "AnalyserNode" , js_name = maxDecibels ) ]
#[doc = "Setter for the `maxDecibels` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/maxDecibels)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn set_max_decibels(this: &AnalyserNode, value: f64);
# [ wasm_bindgen ( structural , method , getter , js_class = "AnalyserNode" , js_name = smoothingTimeConstant ) ]
#[doc = "Getter for the `smoothingTimeConstant` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/smoothingTimeConstant)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn smoothing_time_constant(this: &AnalyserNode) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "AnalyserNode" , js_name = smoothingTimeConstant ) ]
#[doc = "Setter for the `smoothingTimeConstant` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/smoothingTimeConstant)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn set_smoothing_time_constant(this: &AnalyserNode, value: f64);
#[cfg(feature = "BaseAudioContext")]
#[wasm_bindgen(catch, constructor, js_class = "AnalyserNode")]
#[doc = "The `new AnalyserNode(..)` constructor, creating a new instance of `AnalyserNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/AnalyserNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`, `BaseAudioContext`*"]
pub fn new(context: &BaseAudioContext) -> Result<AnalyserNode, JsValue>;
#[cfg(all(feature = "AnalyserOptions", feature = "BaseAudioContext",))]
#[wasm_bindgen(catch, constructor, js_class = "AnalyserNode")]
#[doc = "The `new AnalyserNode(..)` constructor, creating a new instance of `AnalyserNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/AnalyserNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`, `AnalyserOptions`, `BaseAudioContext`*"]
pub fn new_with_options(
context: &BaseAudioContext,
options: &AnalyserOptions,
) -> Result<AnalyserNode, JsValue>;
# [ wasm_bindgen ( method , structural , js_class = "AnalyserNode" , js_name = getByteFrequencyData ) ]
#[doc = "The `getByteFrequencyData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn get_byte_frequency_data(this: &AnalyserNode, array: &mut [u8]);
# [ wasm_bindgen ( method , structural , js_class = "AnalyserNode" , js_name = getByteTimeDomainData ) ]
#[doc = "The `getByteTimeDomainData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteTimeDomainData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn get_byte_time_domain_data(this: &AnalyserNode, array: &mut [u8]);
# [ wasm_bindgen ( method , structural , js_class = "AnalyserNode" , js_name = getFloatFrequencyData ) ]
#[doc = "The `getFloatFrequencyData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getFloatFrequencyData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn get_float_frequency_data(this: &AnalyserNode, array: &mut [f32]);
# [ wasm_bindgen ( method , structural , js_class = "AnalyserNode" , js_name = getFloatTimeDomainData ) ]
#[doc = "The `getFloatTimeDomainData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getFloatTimeDomainData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`*"]
pub fn get_float_time_domain_data(this: &AnalyserNode, array: &mut [f32]);
}

View File

@ -0,0 +1,143 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AnalyserOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnalyserOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
pub type AnalyserOptions;
}
impl AnalyserOptions {
#[doc = "Construct a new `AnalyserOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `channelCount` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
pub fn channel_count(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCount"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelCountMode")]
#[doc = "Change the `channelCountMode` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`, `ChannelCountMode`*"]
pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCountMode"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelInterpretation")]
#[doc = "Change the `channelInterpretation` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`, `ChannelInterpretation`*"]
pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelInterpretation"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `fftSize` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
pub fn fft_size(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("fftSize"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `maxDecibels` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
pub fn max_decibels(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("maxDecibels"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `minDecibels` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
pub fn min_decibels(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("minDecibels"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `smoothingTimeConstant` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserOptions`*"]
pub fn smoothing_time_constant(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("smoothingTimeConstant"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,68 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( is_type_of = | _ | false , extends = :: js_sys :: Object , js_name = ANGLE_instanced_arrays , typescript_type = "ANGLE_instanced_arrays" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AngleInstancedArrays` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AngleInstancedArrays`*"]
pub type AngleInstancedArrays;
# [ wasm_bindgen ( method , structural , js_class = "ANGLE_instanced_arrays" , js_name = drawArraysInstancedANGLE ) ]
#[doc = "The `drawArraysInstancedANGLE()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AngleInstancedArrays`*"]
pub fn draw_arrays_instanced_angle(
this: &AngleInstancedArrays,
mode: u32,
first: i32,
count: i32,
primcount: i32,
);
# [ wasm_bindgen ( method , structural , js_class = "ANGLE_instanced_arrays" , js_name = drawElementsInstancedANGLE ) ]
#[doc = "The `drawElementsInstancedANGLE()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AngleInstancedArrays`*"]
pub fn draw_elements_instanced_angle_with_i32(
this: &AngleInstancedArrays,
mode: u32,
count: i32,
type_: u32,
offset: i32,
primcount: i32,
);
# [ wasm_bindgen ( method , structural , js_class = "ANGLE_instanced_arrays" , js_name = drawElementsInstancedANGLE ) ]
#[doc = "The `drawElementsInstancedANGLE()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AngleInstancedArrays`*"]
pub fn draw_elements_instanced_angle_with_f64(
this: &AngleInstancedArrays,
mode: u32,
count: i32,
type_: u32,
offset: f64,
primcount: i32,
);
# [ wasm_bindgen ( method , structural , js_class = "ANGLE_instanced_arrays" , js_name = vertexAttribDivisorANGLE ) ]
#[doc = "The `vertexAttribDivisorANGLE()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AngleInstancedArrays`*"]
pub fn vertex_attrib_divisor_angle(this: &AngleInstancedArrays, index: u32, divisor: u32);
}
impl AngleInstancedArrays {
#[doc = "The `ANGLE_instanced_arrays.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AngleInstancedArrays`*"]
pub const VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: u32 = 35070u64 as u32;
}

View File

@ -0,0 +1,227 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = Animation , typescript_type = "Animation" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `Animation` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub type Animation;
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = id ) ]
#[doc = "Getter for the `id` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/id)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn id(this: &Animation) -> String;
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = id ) ]
#[doc = "Setter for the `id` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/id)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn set_id(this: &Animation, value: &str);
#[cfg(feature = "AnimationEffect")]
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = effect ) ]
#[doc = "Getter for the `effect` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`, `AnimationEffect`*"]
pub fn effect(this: &Animation) -> Option<AnimationEffect>;
#[cfg(feature = "AnimationEffect")]
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = effect ) ]
#[doc = "Setter for the `effect` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/effect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`, `AnimationEffect`*"]
pub fn set_effect(this: &Animation, value: Option<&AnimationEffect>);
#[cfg(feature = "AnimationTimeline")]
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = timeline ) ]
#[doc = "Getter for the `timeline` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`, `AnimationTimeline`*"]
pub fn timeline(this: &Animation) -> Option<AnimationTimeline>;
#[cfg(feature = "AnimationTimeline")]
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = timeline ) ]
#[doc = "Setter for the `timeline` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/timeline)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`, `AnimationTimeline`*"]
pub fn set_timeline(this: &Animation, value: Option<&AnimationTimeline>);
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = startTime ) ]
#[doc = "Getter for the `startTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/startTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn start_time(this: &Animation) -> Option<f64>;
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = startTime ) ]
#[doc = "Setter for the `startTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/startTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn set_start_time(this: &Animation, value: Option<f64>);
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = currentTime ) ]
#[doc = "Getter for the `currentTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/currentTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn current_time(this: &Animation) -> Option<f64>;
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = currentTime ) ]
#[doc = "Setter for the `currentTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/currentTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn set_current_time(this: &Animation, value: Option<f64>);
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = playbackRate ) ]
#[doc = "Getter for the `playbackRate` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/playbackRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn playback_rate(this: &Animation) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = playbackRate ) ]
#[doc = "Setter for the `playbackRate` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/playbackRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn set_playback_rate(this: &Animation, value: f64);
#[cfg(feature = "AnimationPlayState")]
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = playState ) ]
#[doc = "Getter for the `playState` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/playState)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`, `AnimationPlayState`*"]
pub fn play_state(this: &Animation) -> AnimationPlayState;
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = pending ) ]
#[doc = "Getter for the `pending` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/pending)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn pending(this: &Animation) -> bool;
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "Animation" , js_name = ready ) ]
#[doc = "Getter for the `ready` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/ready)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn ready(this: &Animation) -> Result<::js_sys::Promise, JsValue>;
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "Animation" , js_name = finished ) ]
#[doc = "Getter for the `finished` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/finished)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn finished(this: &Animation) -> Result<::js_sys::Promise, JsValue>;
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = onfinish ) ]
#[doc = "Getter for the `onfinish` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/onfinish)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn onfinish(this: &Animation) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = onfinish ) ]
#[doc = "Setter for the `onfinish` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/onfinish)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn set_onfinish(this: &Animation, value: Option<&::js_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "Animation" , js_name = oncancel ) ]
#[doc = "Getter for the `oncancel` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/oncancel)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn oncancel(this: &Animation) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "Animation" , js_name = oncancel ) ]
#[doc = "Setter for the `oncancel` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/oncancel)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn set_oncancel(this: &Animation, value: Option<&::js_sys::Function>);
#[wasm_bindgen(catch, constructor, js_class = "Animation")]
#[doc = "The `new Animation(..)` constructor, creating a new instance of `Animation`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn new() -> Result<Animation, JsValue>;
#[cfg(feature = "AnimationEffect")]
#[wasm_bindgen(catch, constructor, js_class = "Animation")]
#[doc = "The `new Animation(..)` constructor, creating a new instance of `Animation`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`, `AnimationEffect`*"]
pub fn new_with_effect(effect: Option<&AnimationEffect>) -> Result<Animation, JsValue>;
#[cfg(all(feature = "AnimationEffect", feature = "AnimationTimeline",))]
#[wasm_bindgen(catch, constructor, js_class = "Animation")]
#[doc = "The `new Animation(..)` constructor, creating a new instance of `Animation`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/Animation)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`, `AnimationEffect`, `AnimationTimeline`*"]
pub fn new_with_effect_and_timeline(
effect: Option<&AnimationEffect>,
timeline: Option<&AnimationTimeline>,
) -> Result<Animation, JsValue>;
# [ wasm_bindgen ( method , structural , js_class = "Animation" , js_name = cancel ) ]
#[doc = "The `cancel()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/cancel)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn cancel(this: &Animation);
# [ wasm_bindgen ( catch , method , structural , js_class = "Animation" , js_name = finish ) ]
#[doc = "The `finish()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/finish)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn finish(this: &Animation) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Animation" , js_name = pause ) ]
#[doc = "The `pause()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/pause)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn pause(this: &Animation) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Animation" , js_name = play ) ]
#[doc = "The `play()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/play)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn play(this: &Animation) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Animation" , js_name = reverse ) ]
#[doc = "The `reverse()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/reverse)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn reverse(this: &Animation) -> Result<(), JsValue>;
# [ wasm_bindgen ( method , structural , js_class = "Animation" , js_name = updatePlaybackRate ) ]
#[doc = "The `updatePlaybackRate()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Animation/updatePlaybackRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Animation`*"]
pub fn update_playback_rate(this: &Animation, playback_rate: f64);
}

View File

@ -0,0 +1,48 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AnimationEffect , typescript_type = "AnimationEffect" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationEffect` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEffect`*"]
pub type AnimationEffect;
#[cfg(feature = "ComputedEffectTiming")]
# [ wasm_bindgen ( method , structural , js_class = "AnimationEffect" , js_name = getComputedTiming ) ]
#[doc = "The `getComputedTiming()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getComputedTiming)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEffect`, `ComputedEffectTiming`*"]
pub fn get_computed_timing(this: &AnimationEffect) -> ComputedEffectTiming;
#[cfg(feature = "EffectTiming")]
# [ wasm_bindgen ( method , structural , js_class = "AnimationEffect" , js_name = getTiming ) ]
#[doc = "The `getTiming()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getTiming)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEffect`, `EffectTiming`*"]
pub fn get_timing(this: &AnimationEffect) -> EffectTiming;
# [ wasm_bindgen ( catch , method , structural , js_class = "AnimationEffect" , js_name = updateTiming ) ]
#[doc = "The `updateTiming()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/updateTiming)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEffect`*"]
pub fn update_timing(this: &AnimationEffect) -> Result<(), JsValue>;
#[cfg(feature = "OptionalEffectTiming")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AnimationEffect" , js_name = updateTiming ) ]
#[doc = "The `updateTiming()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/updateTiming)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEffect`, `OptionalEffectTiming`*"]
pub fn update_timing_with_timing(
this: &AnimationEffect,
timing: &OptionalEffectTiming,
) -> Result<(), JsValue>;
}

View File

@ -0,0 +1,53 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = Event , extends = :: js_sys :: Object , js_name = AnimationEvent , typescript_type = "AnimationEvent" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationEvent` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`*"]
pub type AnimationEvent;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnimationEvent" , js_name = animationName ) ]
#[doc = "Getter for the `animationName` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/animationName)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`*"]
pub fn animation_name(this: &AnimationEvent) -> String;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnimationEvent" , js_name = elapsedTime ) ]
#[doc = "Getter for the `elapsedTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/elapsedTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`*"]
pub fn elapsed_time(this: &AnimationEvent) -> f32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnimationEvent" , js_name = pseudoElement ) ]
#[doc = "Getter for the `pseudoElement` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/pseudoElement)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`*"]
pub fn pseudo_element(this: &AnimationEvent) -> String;
#[wasm_bindgen(catch, constructor, js_class = "AnimationEvent")]
#[doc = "The `new AnimationEvent(..)` constructor, creating a new instance of `AnimationEvent`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/AnimationEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`*"]
pub fn new(type_: &str) -> Result<AnimationEvent, JsValue>;
#[cfg(feature = "AnimationEventInit")]
#[wasm_bindgen(catch, constructor, js_class = "AnimationEvent")]
#[doc = "The `new AnimationEvent(..)` constructor, creating a new instance of `AnimationEvent`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/AnimationEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEvent`, `AnimationEventInit`*"]
pub fn new_with_event_init_dict(
type_: &str,
event_init_dict: &AnimationEventInit,
) -> Result<AnimationEvent, JsValue>;
}

View File

@ -0,0 +1,124 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AnimationEventInit ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationEventInit` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub type AnimationEventInit;
}
impl AnimationEventInit {
#[doc = "Construct a new `AnimationEventInit`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `bubbles` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub fn bubbles(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("bubbles"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `cancelable` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub fn cancelable(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("cancelable"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `composed` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub fn composed(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composed"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `animationName` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub fn animation_name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("animationName"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `elapsedTime` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub fn elapsed_time(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("elapsedTime"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `pseudoElement` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationEventInit`*"]
pub fn pseudo_element(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("pseudoElement"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,13 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AnimationPlayState` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlayState`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AnimationPlayState {
Idle = "idle",
Running = "running",
Paused = "paused",
Finished = "finished",
}

View File

@ -0,0 +1,46 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = Event , extends = :: js_sys :: Object , js_name = AnimationPlaybackEvent , typescript_type = "AnimationPlaybackEvent" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationPlaybackEvent` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEvent`*"]
pub type AnimationPlaybackEvent;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnimationPlaybackEvent" , js_name = currentTime ) ]
#[doc = "Getter for the `currentTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent/currentTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEvent`*"]
pub fn current_time(this: &AnimationPlaybackEvent) -> Option<f64>;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnimationPlaybackEvent" , js_name = timelineTime ) ]
#[doc = "Getter for the `timelineTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent/timelineTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEvent`*"]
pub fn timeline_time(this: &AnimationPlaybackEvent) -> Option<f64>;
#[wasm_bindgen(catch, constructor, js_class = "AnimationPlaybackEvent")]
#[doc = "The `new AnimationPlaybackEvent(..)` constructor, creating a new instance of `AnimationPlaybackEvent`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent/AnimationPlaybackEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEvent`*"]
pub fn new(type_: &str) -> Result<AnimationPlaybackEvent, JsValue>;
#[cfg(feature = "AnimationPlaybackEventInit")]
#[wasm_bindgen(catch, constructor, js_class = "AnimationPlaybackEvent")]
#[doc = "The `new AnimationPlaybackEvent(..)` constructor, creating a new instance of `AnimationPlaybackEvent`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent/AnimationPlaybackEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEvent`, `AnimationPlaybackEventInit`*"]
pub fn new_with_event_init_dict(
type_: &str,
event_init_dict: &AnimationPlaybackEventInit,
) -> Result<AnimationPlaybackEvent, JsValue>;
}

View File

@ -0,0 +1,107 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AnimationPlaybackEventInit ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationPlaybackEventInit` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"]
pub type AnimationPlaybackEventInit;
}
impl AnimationPlaybackEventInit {
#[doc = "Construct a new `AnimationPlaybackEventInit`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `bubbles` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"]
pub fn bubbles(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("bubbles"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `cancelable` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"]
pub fn cancelable(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("cancelable"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `composed` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"]
pub fn composed(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composed"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `currentTime` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"]
pub fn current_time(&mut self, val: Option<f64>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("currentTime"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `timelineTime` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPlaybackEventInit`*"]
pub fn timeline_time(&mut self, val: Option<f64>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("timelineTime"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,94 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AnimationPropertyDetails ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationPropertyDetails` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
pub type AnimationPropertyDetails;
}
impl AnimationPropertyDetails {
#[doc = "Construct a new `AnimationPropertyDetails`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
pub fn new(
property: &str,
running_on_compositor: bool,
values: &::wasm_bindgen::JsValue,
) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.property(property);
ret.running_on_compositor(running_on_compositor);
ret.values(values);
ret
}
#[doc = "Change the `property` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
pub fn property(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("property"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `runningOnCompositor` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
pub fn running_on_compositor(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("runningOnCompositor"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `values` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
pub fn values(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("values"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `warning` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyDetails`*"]
pub fn warning(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("warning"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,84 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AnimationPropertyValueDetails ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationPropertyValueDetails` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
pub type AnimationPropertyValueDetails;
}
impl AnimationPropertyValueDetails {
#[cfg(feature = "CompositeOperation")]
#[doc = "Construct a new `AnimationPropertyValueDetails`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`, `CompositeOperation`*"]
pub fn new(composite: CompositeOperation, offset: f64) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.composite(composite);
ret.offset(offset);
ret
}
#[cfg(feature = "CompositeOperation")]
#[doc = "Change the `composite` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`, `CompositeOperation`*"]
pub fn composite(&mut self, val: CompositeOperation) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composite"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `easing` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
pub fn easing(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `offset` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
pub fn offset(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `value` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationPropertyValueDetails`*"]
pub fn value(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,21 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AnimationTimeline , typescript_type = "AnimationTimeline" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AnimationTimeline` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationTimeline)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationTimeline`*"]
pub type AnimationTimeline;
# [ wasm_bindgen ( structural , method , getter , js_class = "AnimationTimeline" , js_name = currentTime ) ]
#[doc = "Getter for the `currentTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AnimationTimeline/currentTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnimationTimeline`*"]
pub fn current_time(this: &AnimationTimeline) -> Option<f64>;
}

View File

@ -0,0 +1,39 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AssignedNodesOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AssignedNodesOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"]
pub type AssignedNodesOptions;
}
impl AssignedNodesOptions {
#[doc = "Construct a new `AssignedNodesOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `flatten` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AssignedNodesOptions`*"]
pub fn flatten(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("flatten"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,12 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AttestationConveyancePreference` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AttestationConveyancePreference`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AttestationConveyancePreference {
None = "none",
Indirect = "indirect",
Direct = "direct",
}

View File

@ -0,0 +1,63 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = Node , extends = EventTarget , extends = :: js_sys :: Object , js_name = Attr , typescript_type = "Attr" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `Attr` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub type Attr;
# [ wasm_bindgen ( structural , method , getter , js_class = "Attr" , js_name = localName ) ]
#[doc = "Getter for the `localName` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/localName)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub fn local_name(this: &Attr) -> String;
# [ wasm_bindgen ( structural , method , getter , js_class = "Attr" , js_name = value ) ]
#[doc = "Getter for the `value` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/value)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub fn value(this: &Attr) -> String;
# [ wasm_bindgen ( structural , method , setter , js_class = "Attr" , js_name = value ) ]
#[doc = "Setter for the `value` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/value)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub fn set_value(this: &Attr, value: &str);
# [ wasm_bindgen ( structural , method , getter , js_class = "Attr" , js_name = name ) ]
#[doc = "Getter for the `name` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/name)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub fn name(this: &Attr) -> String;
# [ wasm_bindgen ( structural , method , getter , js_class = "Attr" , js_name = namespaceURI ) ]
#[doc = "Getter for the `namespaceURI` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/namespaceURI)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub fn namespace_uri(this: &Attr) -> Option<String>;
# [ wasm_bindgen ( structural , method , getter , js_class = "Attr" , js_name = prefix ) ]
#[doc = "Getter for the `prefix` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/prefix)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub fn prefix(this: &Attr) -> Option<String>;
# [ wasm_bindgen ( structural , method , getter , js_class = "Attr" , js_name = specified ) ]
#[doc = "Getter for the `specified` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Attr/specified)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Attr`*"]
pub fn specified(this: &Attr) -> bool;
}

View File

@ -0,0 +1,50 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AttributeNameValue ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AttributeNameValue` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
pub type AttributeNameValue;
}
impl AttributeNameValue {
#[doc = "Construct a new `AttributeNameValue`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
pub fn new(name: &str, value: &str) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.name(name);
ret.value(value);
ret
}
#[doc = "Change the `name` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
pub fn name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `value` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AttributeNameValue`*"]
pub fn value(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,103 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioBuffer , typescript_type = "AudioBuffer" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioBuffer` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub type AudioBuffer;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBuffer" , js_name = sampleRate ) ]
#[doc = "Getter for the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/sampleRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn sample_rate(this: &AudioBuffer) -> f32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBuffer" , js_name = length ) ]
#[doc = "Getter for the `length` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/length)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn length(this: &AudioBuffer) -> u32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBuffer" , js_name = duration ) ]
#[doc = "Getter for the `duration` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/duration)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn duration(this: &AudioBuffer) -> f64;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBuffer" , js_name = numberOfChannels ) ]
#[doc = "Getter for the `numberOfChannels` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/numberOfChannels)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn number_of_channels(this: &AudioBuffer) -> u32;
#[cfg(feature = "AudioBufferOptions")]
#[wasm_bindgen(catch, constructor, js_class = "AudioBuffer")]
#[doc = "The `new AudioBuffer(..)` constructor, creating a new instance of `AudioBuffer`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/AudioBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferOptions`*"]
pub fn new(options: &AudioBufferOptions) -> Result<AudioBuffer, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBuffer" , js_name = copyFromChannel ) ]
#[doc = "The `copyFromChannel()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyFromChannel)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn copy_from_channel(
this: &AudioBuffer,
destination: &mut [f32],
channel_number: i32,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBuffer" , js_name = copyFromChannel ) ]
#[doc = "The `copyFromChannel()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyFromChannel)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn copy_from_channel_with_start_in_channel(
this: &AudioBuffer,
destination: &mut [f32],
channel_number: i32,
start_in_channel: u32,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel ) ]
#[doc = "The `copyToChannel()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn copy_to_channel(
this: &AudioBuffer,
source: &mut [f32],
channel_number: i32,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel ) ]
#[doc = "The `copyToChannel()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn copy_to_channel_with_start_in_channel(
this: &AudioBuffer,
source: &mut [f32],
channel_number: i32,
start_in_channel: u32,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBuffer" , js_name = getChannelData ) ]
#[doc = "The `getChannelData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/getChannelData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
pub fn get_channel_data(this: &AudioBuffer, channel: u32) -> Result<Vec<f32>, JsValue>;
}

View File

@ -0,0 +1,72 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioBufferOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioBufferOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"]
pub type AudioBufferOptions;
}
impl AudioBufferOptions {
#[doc = "Construct a new `AudioBufferOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"]
pub fn new(length: u32, sample_rate: f32) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.length(length);
ret.sample_rate(sample_rate);
ret
}
#[doc = "Change the `length` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"]
pub fn length(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `numberOfChannels` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"]
pub fn number_of_channels(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("numberOfChannels"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferOptions`*"]
pub fn sample_rate(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("sampleRate"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,172 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AudioScheduledSourceNode , extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioBufferSourceNode , typescript_type = "AudioBufferSourceNode" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioBufferSourceNode` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub type AudioBufferSourceNode;
#[cfg(feature = "AudioBuffer")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = buffer ) ]
#[doc = "Getter for the `buffer` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/buffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceNode`*"]
pub fn buffer(this: &AudioBufferSourceNode) -> Option<AudioBuffer>;
#[cfg(feature = "AudioBuffer")]
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = buffer ) ]
#[doc = "Setter for the `buffer` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/buffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceNode`*"]
pub fn set_buffer(this: &AudioBufferSourceNode, value: Option<&AudioBuffer>);
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = playbackRate ) ]
#[doc = "Getter for the `playbackRate` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/playbackRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioParam`*"]
pub fn playback_rate(this: &AudioBufferSourceNode) -> AudioParam;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = detune ) ]
#[doc = "Getter for the `detune` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/detune)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioParam`*"]
pub fn detune(this: &AudioBufferSourceNode) -> AudioParam;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = loop ) ]
#[doc = "Getter for the `loop` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn loop_(this: &AudioBufferSourceNode) -> bool;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = loop ) ]
#[doc = "Setter for the `loop` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn set_loop(this: &AudioBufferSourceNode, value: bool);
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = loopStart ) ]
#[doc = "Getter for the `loopStart` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopStart)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn loop_start(this: &AudioBufferSourceNode) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = loopStart ) ]
#[doc = "Setter for the `loopStart` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopStart)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn set_loop_start(this: &AudioBufferSourceNode, value: f64);
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = loopEnd ) ]
#[doc = "Getter for the `loopEnd` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopEnd)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn loop_end(this: &AudioBufferSourceNode) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = loopEnd ) ]
#[doc = "Setter for the `loopEnd` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopEnd)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn set_loop_end(this: &AudioBufferSourceNode, value: f64);
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioBufferSourceNode" , js_name = onended ) ]
#[doc = "Getter for the `onended` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/onended)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn onended(this: &AudioBufferSourceNode) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioBufferSourceNode" , js_name = onended ) ]
#[doc = "Setter for the `onended` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/onended)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn set_onended(this: &AudioBufferSourceNode, value: Option<&::js_sys::Function>);
#[cfg(feature = "BaseAudioContext")]
#[wasm_bindgen(catch, constructor, js_class = "AudioBufferSourceNode")]
#[doc = "The `new AudioBufferSourceNode(..)` constructor, creating a new instance of `AudioBufferSourceNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/AudioBufferSourceNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `BaseAudioContext`*"]
pub fn new(context: &BaseAudioContext) -> Result<AudioBufferSourceNode, JsValue>;
#[cfg(all(feature = "AudioBufferSourceOptions", feature = "BaseAudioContext",))]
#[wasm_bindgen(catch, constructor, js_class = "AudioBufferSourceNode")]
#[doc = "The `new AudioBufferSourceNode(..)` constructor, creating a new instance of `AudioBufferSourceNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/AudioBufferSourceNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioBufferSourceOptions`, `BaseAudioContext`*"]
pub fn new_with_options(
context: &BaseAudioContext,
options: &AudioBufferSourceOptions,
) -> Result<AudioBufferSourceNode, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start ) ]
#[doc = "The `start()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn start(this: &AudioBufferSourceNode) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start ) ]
#[doc = "The `start()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn start_with_when(this: &AudioBufferSourceNode, when: f64) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start ) ]
#[doc = "The `start()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn start_with_when_and_grain_offset(
this: &AudioBufferSourceNode,
when: f64,
grain_offset: f64,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = start ) ]
#[doc = "The `start()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn start_with_when_and_grain_offset_and_grain_duration(
this: &AudioBufferSourceNode,
when: f64,
grain_offset: f64,
grain_duration: f64,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = stop ) ]
#[doc = "The `stop()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/stop)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn stop(this: &AudioBufferSourceNode) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioBufferSourceNode" , js_name = stop ) ]
#[doc = "The `stop()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/stop)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`*"]
pub fn stop_with_when(this: &AudioBufferSourceNode, when: f64) -> Result<(), JsValue>;
}

View File

@ -0,0 +1,115 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioBufferSourceOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioBufferSourceOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
pub type AudioBufferSourceOptions;
}
impl AudioBufferSourceOptions {
#[doc = "Construct a new `AudioBufferSourceOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(feature = "AudioBuffer")]
#[doc = "Change the `buffer` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferSourceOptions`*"]
pub fn buffer(&mut self, val: Option<&AudioBuffer>) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `detune` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
pub fn detune(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detune"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `loop` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
pub fn loop_(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("loop"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `loopEnd` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
pub fn loop_end(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("loopEnd"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `loopStart` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
pub fn loop_start(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("loopStart"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `playbackRate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceOptions`*"]
pub fn playback_rate(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("playbackRate"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,90 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioConfiguration ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioConfiguration` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
pub type AudioConfiguration;
}
impl AudioConfiguration {
#[doc = "Construct a new `AudioConfiguration`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `bitrate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
pub fn bitrate(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("bitrate"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `channels` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
pub fn channels(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channels"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `contentType` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
pub fn content_type(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("contentType"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `samplerate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioConfiguration`*"]
pub fn samplerate(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("samplerate"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,418 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( vendor_prefix = webkit , extends = BaseAudioContext , extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioContext , typescript_type = "AudioContext" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioContext` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub type AudioContext;
#[cfg(feature = "AudioDestinationNode")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioContext" , js_name = destination ) ]
#[doc = "Getter for the `destination` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/destination)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioDestinationNode`*"]
pub fn destination(this: &AudioContext) -> AudioDestinationNode;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioContext" , js_name = sampleRate ) ]
#[doc = "Getter for the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/sampleRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn sample_rate(this: &AudioContext) -> f32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioContext" , js_name = currentTime ) ]
#[doc = "Getter for the `currentTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/currentTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn current_time(this: &AudioContext) -> f64;
#[cfg(feature = "AudioListener")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioContext" , js_name = listener ) ]
#[doc = "Getter for the `listener` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/listener)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioListener`*"]
pub fn listener(this: &AudioContext) -> AudioListener;
#[cfg(feature = "AudioContextState")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioContext" , js_name = state ) ]
#[doc = "Getter for the `state` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/state)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioContextState`*"]
pub fn state(this: &AudioContext) -> AudioContextState;
#[cfg(feature = "AudioWorklet")]
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "AudioContext" , js_name = audioWorklet ) ]
#[doc = "Getter for the `audioWorklet` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/audioWorklet)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioWorklet`*"]
pub fn audio_worklet(this: &AudioContext) -> Result<AudioWorklet, JsValue>;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioContext" , js_name = onstatechange ) ]
#[doc = "Getter for the `onstatechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onstatechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn onstatechange(this: &AudioContext) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioContext" , js_name = onstatechange ) ]
#[doc = "Setter for the `onstatechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onstatechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn set_onstatechange(this: &AudioContext, value: Option<&::js_sys::Function>);
#[wasm_bindgen(catch, constructor, js_class = "AudioContext")]
#[doc = "The `new AudioContext(..)` constructor, creating a new instance of `AudioContext`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn new() -> Result<AudioContext, JsValue>;
#[cfg(feature = "AudioContextOptions")]
#[wasm_bindgen(catch, constructor, js_class = "AudioContext")]
#[doc = "The `new AudioContext(..)` constructor, creating a new instance of `AudioContext`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioContextOptions`*"]
pub fn new_with_context_options(
context_options: &AudioContextOptions,
) -> Result<AudioContext, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = close ) ]
#[doc = "The `close()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/close)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn close(this: &AudioContext) -> Result<::js_sys::Promise, JsValue>;
#[cfg(all(feature = "HtmlMediaElement", feature = "MediaElementAudioSourceNode",))]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createMediaElementSource ) ]
#[doc = "The `createMediaElementSource()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaElementSource)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `HtmlMediaElement`, `MediaElementAudioSourceNode`*"]
pub fn create_media_element_source(
this: &AudioContext,
media_element: &HtmlMediaElement,
) -> Result<MediaElementAudioSourceNode, JsValue>;
#[cfg(feature = "MediaStreamAudioDestinationNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createMediaStreamDestination ) ]
#[doc = "The `createMediaStreamDestination()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaStreamDestination)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `MediaStreamAudioDestinationNode`*"]
pub fn create_media_stream_destination(
this: &AudioContext,
) -> Result<MediaStreamAudioDestinationNode, JsValue>;
#[cfg(all(feature = "MediaStream", feature = "MediaStreamAudioSourceNode",))]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createMediaStreamSource ) ]
#[doc = "The `createMediaStreamSource()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaStreamSource)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `MediaStream`, `MediaStreamAudioSourceNode`*"]
pub fn create_media_stream_source(
this: &AudioContext,
media_stream: &MediaStream,
) -> Result<MediaStreamAudioSourceNode, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = suspend ) ]
#[doc = "The `suspend()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/suspend)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn suspend(this: &AudioContext) -> Result<::js_sys::Promise, JsValue>;
#[cfg(feature = "AnalyserNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createAnalyser ) ]
#[doc = "The `createAnalyser()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createAnalyser)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`, `AudioContext`*"]
pub fn create_analyser(this: &AudioContext) -> Result<AnalyserNode, JsValue>;
#[cfg(feature = "BiquadFilterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createBiquadFilter ) ]
#[doc = "The `createBiquadFilter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBiquadFilter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `BiquadFilterNode`*"]
pub fn create_biquad_filter(this: &AudioContext) -> Result<BiquadFilterNode, JsValue>;
#[cfg(feature = "AudioBuffer")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createBuffer ) ]
#[doc = "The `createBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioContext`*"]
pub fn create_buffer(
this: &AudioContext,
number_of_channels: u32,
length: u32,
sample_rate: f32,
) -> Result<AudioBuffer, JsValue>;
#[cfg(feature = "AudioBufferSourceNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createBufferSource ) ]
#[doc = "The `createBufferSource()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBufferSource)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioContext`*"]
pub fn create_buffer_source(this: &AudioContext) -> Result<AudioBufferSourceNode, JsValue>;
#[cfg(feature = "ChannelMergerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createChannelMerger ) ]
#[doc = "The `createChannelMerger()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelMerger)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelMergerNode`*"]
pub fn create_channel_merger(this: &AudioContext) -> Result<ChannelMergerNode, JsValue>;
#[cfg(feature = "ChannelMergerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createChannelMerger ) ]
#[doc = "The `createChannelMerger()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelMerger)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelMergerNode`*"]
pub fn create_channel_merger_with_number_of_inputs(
this: &AudioContext,
number_of_inputs: u32,
) -> Result<ChannelMergerNode, JsValue>;
#[cfg(feature = "ChannelSplitterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createChannelSplitter ) ]
#[doc = "The `createChannelSplitter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelSplitter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelSplitterNode`*"]
pub fn create_channel_splitter(this: &AudioContext) -> Result<ChannelSplitterNode, JsValue>;
#[cfg(feature = "ChannelSplitterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createChannelSplitter ) ]
#[doc = "The `createChannelSplitter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelSplitter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelSplitterNode`*"]
pub fn create_channel_splitter_with_number_of_outputs(
this: &AudioContext,
number_of_outputs: u32,
) -> Result<ChannelSplitterNode, JsValue>;
#[cfg(feature = "ConstantSourceNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createConstantSource ) ]
#[doc = "The `createConstantSource()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createConstantSource)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ConstantSourceNode`*"]
pub fn create_constant_source(this: &AudioContext) -> Result<ConstantSourceNode, JsValue>;
#[cfg(feature = "ConvolverNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createConvolver ) ]
#[doc = "The `createConvolver()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createConvolver)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ConvolverNode`*"]
pub fn create_convolver(this: &AudioContext) -> Result<ConvolverNode, JsValue>;
#[cfg(feature = "DelayNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createDelay ) ]
#[doc = "The `createDelay()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createDelay)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `DelayNode`*"]
pub fn create_delay(this: &AudioContext) -> Result<DelayNode, JsValue>;
#[cfg(feature = "DelayNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createDelay ) ]
#[doc = "The `createDelay()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createDelay)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `DelayNode`*"]
pub fn create_delay_with_max_delay_time(
this: &AudioContext,
max_delay_time: f64,
) -> Result<DelayNode, JsValue>;
#[cfg(feature = "DynamicsCompressorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createDynamicsCompressor ) ]
#[doc = "The `createDynamicsCompressor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createDynamicsCompressor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `DynamicsCompressorNode`*"]
pub fn create_dynamics_compressor(
this: &AudioContext,
) -> Result<DynamicsCompressorNode, JsValue>;
#[cfg(feature = "GainNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createGain ) ]
#[doc = "The `createGain()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `GainNode`*"]
pub fn create_gain(this: &AudioContext) -> Result<GainNode, JsValue>;
#[cfg(feature = "IirFilterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createIIRFilter ) ]
#[doc = "The `createIIRFilter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createIIRFilter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `IirFilterNode`*"]
pub fn create_iir_filter(
this: &AudioContext,
feedforward: &::wasm_bindgen::JsValue,
feedback: &::wasm_bindgen::JsValue,
) -> Result<IirFilterNode, JsValue>;
#[cfg(feature = "OscillatorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createOscillator ) ]
#[doc = "The `createOscillator()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createOscillator)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `OscillatorNode`*"]
pub fn create_oscillator(this: &AudioContext) -> Result<OscillatorNode, JsValue>;
#[cfg(feature = "PannerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createPanner ) ]
#[doc = "The `createPanner()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPanner)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PannerNode`*"]
pub fn create_panner(this: &AudioContext) -> Result<PannerNode, JsValue>;
#[cfg(feature = "PeriodicWave")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createPeriodicWave ) ]
#[doc = "The `createPeriodicWave()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`*"]
pub fn create_periodic_wave(
this: &AudioContext,
real: &mut [f32],
imag: &mut [f32],
) -> Result<PeriodicWave, JsValue>;
#[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createPeriodicWave ) ]
#[doc = "The `createPeriodicWave()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"]
pub fn create_periodic_wave_with_constraints(
this: &AudioContext,
real: &mut [f32],
imag: &mut [f32],
constraints: &PeriodicWaveConstraints,
) -> Result<PeriodicWave, JsValue>;
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor(this: &AudioContext) -> Result<ScriptProcessorNode, JsValue>;
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor_with_buffer_size(
this: &AudioContext,
buffer_size: u32,
) -> Result<ScriptProcessorNode, JsValue>;
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels(
this: &AudioContext,
buffer_size: u32,
number_of_input_channels: u32,
) -> Result<ScriptProcessorNode, JsValue>;
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels_and_number_of_output_channels(
this: &AudioContext,
buffer_size: u32,
number_of_input_channels: u32,
number_of_output_channels: u32,
) -> Result<ScriptProcessorNode, JsValue>;
#[cfg(feature = "StereoPannerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createStereoPanner ) ]
#[doc = "The `createStereoPanner()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createStereoPanner)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `StereoPannerNode`*"]
pub fn create_stereo_panner(this: &AudioContext) -> Result<StereoPannerNode, JsValue>;
#[cfg(feature = "WaveShaperNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = createWaveShaper ) ]
#[doc = "The `createWaveShaper()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createWaveShaper)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`, `WaveShaperNode`*"]
pub fn create_wave_shaper(this: &AudioContext) -> Result<WaveShaperNode, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = decodeAudioData ) ]
#[doc = "The `decodeAudioData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn decode_audio_data(
this: &AudioContext,
audio_data: &::js_sys::ArrayBuffer,
) -> Result<::js_sys::Promise, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = decodeAudioData ) ]
#[doc = "The `decodeAudioData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn decode_audio_data_with_success_callback(
this: &AudioContext,
audio_data: &::js_sys::ArrayBuffer,
success_callback: &::js_sys::Function,
) -> Result<::js_sys::Promise, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = decodeAudioData ) ]
#[doc = "The `decodeAudioData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn decode_audio_data_with_success_callback_and_error_callback(
this: &AudioContext,
audio_data: &::js_sys::ArrayBuffer,
success_callback: &::js_sys::Function,
error_callback: &::js_sys::Function,
) -> Result<::js_sys::Promise, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioContext" , js_name = resume ) ]
#[doc = "The `resume()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/resume)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
pub fn resume(this: &AudioContext) -> Result<::js_sys::Promise, JsValue>;
}

View File

@ -0,0 +1,39 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioContextOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioContextOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"]
pub type AudioContextOptions;
}
impl AudioContextOptions {
#[doc = "Construct a new `AudioContextOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextOptions`*"]
pub fn sample_rate(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("sampleRate"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,12 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AudioContextState` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextState`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AudioContextState {
Suspended = "suspended",
Running = "running",
Closed = "closed",
}

View File

@ -0,0 +1,21 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioDestinationNode , typescript_type = "AudioDestinationNode" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioDestinationNode` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDestinationNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioDestinationNode`*"]
pub type AudioDestinationNode;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioDestinationNode" , js_name = maxChannelCount ) ]
#[doc = "Getter for the `maxChannelCount` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDestinationNode/maxChannelCount)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioDestinationNode`*"]
pub fn max_channel_count(this: &AudioDestinationNode) -> u32;
}

View File

@ -0,0 +1,71 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioListener , typescript_type = "AudioListener" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioListener` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub type AudioListener;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioListener" , js_name = dopplerFactor ) ]
#[doc = "Getter for the `dopplerFactor` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener/dopplerFactor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub fn doppler_factor(this: &AudioListener) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioListener" , js_name = dopplerFactor ) ]
#[doc = "Setter for the `dopplerFactor` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener/dopplerFactor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub fn set_doppler_factor(this: &AudioListener, value: f64);
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioListener" , js_name = speedOfSound ) ]
#[doc = "Getter for the `speedOfSound` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener/speedOfSound)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub fn speed_of_sound(this: &AudioListener) -> f64;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioListener" , js_name = speedOfSound ) ]
#[doc = "Setter for the `speedOfSound` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener/speedOfSound)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub fn set_speed_of_sound(this: &AudioListener, value: f64);
# [ wasm_bindgen ( method , structural , js_class = "AudioListener" , js_name = setOrientation ) ]
#[doc = "The `setOrientation()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener/setOrientation)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub fn set_orientation(
this: &AudioListener,
x: f64,
y: f64,
z: f64,
x_up: f64,
y_up: f64,
z_up: f64,
);
# [ wasm_bindgen ( method , structural , js_class = "AudioListener" , js_name = setPosition ) ]
#[doc = "The `setPosition()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener/setPosition)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub fn set_position(this: &AudioListener, x: f64, y: f64, z: f64);
# [ wasm_bindgen ( method , structural , js_class = "AudioListener" , js_name = setVelocity ) ]
#[doc = "The `setVelocity()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioListener/setVelocity)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`*"]
pub fn set_velocity(this: &AudioListener, x: f64, y: f64, z: f64);
}

View File

@ -0,0 +1,208 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioNode , typescript_type = "AudioNode" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioNode` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub type AudioNode;
#[cfg(feature = "BaseAudioContext")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioNode" , js_name = context ) ]
#[doc = "Getter for the `context` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/context)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `BaseAudioContext`*"]
pub fn context(this: &AudioNode) -> BaseAudioContext;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioNode" , js_name = numberOfInputs ) ]
#[doc = "Getter for the `numberOfInputs` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/numberOfInputs)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn number_of_inputs(this: &AudioNode) -> u32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioNode" , js_name = numberOfOutputs ) ]
#[doc = "Getter for the `numberOfOutputs` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/numberOfOutputs)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn number_of_outputs(this: &AudioNode) -> u32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioNode" , js_name = channelCount ) ]
#[doc = "Getter for the `channelCount` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelCount)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn channel_count(this: &AudioNode) -> u32;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioNode" , js_name = channelCount ) ]
#[doc = "Setter for the `channelCount` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelCount)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn set_channel_count(this: &AudioNode, value: u32);
#[cfg(feature = "ChannelCountMode")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioNode" , js_name = channelCountMode ) ]
#[doc = "Getter for the `channelCountMode` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelCountMode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `ChannelCountMode`*"]
pub fn channel_count_mode(this: &AudioNode) -> ChannelCountMode;
#[cfg(feature = "ChannelCountMode")]
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioNode" , js_name = channelCountMode ) ]
#[doc = "Setter for the `channelCountMode` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelCountMode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `ChannelCountMode`*"]
pub fn set_channel_count_mode(this: &AudioNode, value: ChannelCountMode);
#[cfg(feature = "ChannelInterpretation")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioNode" , js_name = channelInterpretation ) ]
#[doc = "Getter for the `channelInterpretation` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelInterpretation)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `ChannelInterpretation`*"]
pub fn channel_interpretation(this: &AudioNode) -> ChannelInterpretation;
#[cfg(feature = "ChannelInterpretation")]
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioNode" , js_name = channelInterpretation ) ]
#[doc = "Setter for the `channelInterpretation` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/channelInterpretation)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `ChannelInterpretation`*"]
pub fn set_channel_interpretation(this: &AudioNode, value: ChannelInterpretation);
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = connect ) ]
#[doc = "The `connect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/connect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn connect_with_audio_node(
this: &AudioNode,
destination: &AudioNode,
) -> Result<AudioNode, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = connect ) ]
#[doc = "The `connect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/connect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn connect_with_audio_node_and_output(
this: &AudioNode,
destination: &AudioNode,
output: u32,
) -> Result<AudioNode, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = connect ) ]
#[doc = "The `connect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/connect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn connect_with_audio_node_and_output_and_input(
this: &AudioNode,
destination: &AudioNode,
output: u32,
input: u32,
) -> Result<AudioNode, JsValue>;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = connect ) ]
#[doc = "The `connect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/connect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `AudioParam`*"]
pub fn connect_with_audio_param(
this: &AudioNode,
destination: &AudioParam,
) -> Result<(), JsValue>;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = connect ) ]
#[doc = "The `connect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/connect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `AudioParam`*"]
pub fn connect_with_audio_param_and_output(
this: &AudioNode,
destination: &AudioParam,
output: u32,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = disconnect ) ]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn disconnect(this: &AudioNode) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = disconnect ) ]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn disconnect_with_output(this: &AudioNode, output: u32) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = disconnect ) ]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn disconnect_with_audio_node(
this: &AudioNode,
destination: &AudioNode,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = disconnect ) ]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn disconnect_with_audio_node_and_output(
this: &AudioNode,
destination: &AudioNode,
output: u32,
) -> Result<(), JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = disconnect ) ]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`*"]
pub fn disconnect_with_audio_node_and_output_and_input(
this: &AudioNode,
destination: &AudioNode,
output: u32,
input: u32,
) -> Result<(), JsValue>;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = disconnect ) ]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `AudioParam`*"]
pub fn disconnect_with_audio_param(
this: &AudioNode,
destination: &AudioParam,
) -> Result<(), JsValue>;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioNode" , js_name = disconnect ) ]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioNode/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNode`, `AudioParam`*"]
pub fn disconnect_with_audio_param_and_output(
this: &AudioNode,
destination: &AudioParam,
output: u32,
) -> Result<(), JsValue>;
}

View File

@ -0,0 +1,75 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioNodeOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioNodeOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"]
pub type AudioNodeOptions;
}
impl AudioNodeOptions {
#[doc = "Construct a new `AudioNodeOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `channelCount` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`*"]
pub fn channel_count(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCount"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelCountMode")]
#[doc = "Change the `channelCountMode` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`, `ChannelCountMode`*"]
pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCountMode"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelInterpretation")]
#[doc = "Change the `channelInterpretation` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioNodeOptions`, `ChannelInterpretation`*"]
pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelInterpretation"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,116 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioParam , typescript_type = "AudioParam" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioParam` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub type AudioParam;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioParam" , js_name = value ) ]
#[doc = "Getter for the `value` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/value)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn value(this: &AudioParam) -> f32;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioParam" , js_name = value ) ]
#[doc = "Setter for the `value` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/value)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn set_value(this: &AudioParam, value: f32);
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioParam" , js_name = defaultValue ) ]
#[doc = "Getter for the `defaultValue` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/defaultValue)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn default_value(this: &AudioParam) -> f32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioParam" , js_name = minValue ) ]
#[doc = "Getter for the `minValue` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/minValue)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn min_value(this: &AudioParam) -> f32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioParam" , js_name = maxValue ) ]
#[doc = "Getter for the `maxValue` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/maxValue)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn max_value(this: &AudioParam) -> f32;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioParam" , js_name = cancelScheduledValues ) ]
#[doc = "The `cancelScheduledValues()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/cancelScheduledValues)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn cancel_scheduled_values(
this: &AudioParam,
start_time: f64,
) -> Result<AudioParam, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioParam" , js_name = exponentialRampToValueAtTime ) ]
#[doc = "The `exponentialRampToValueAtTime()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/exponentialRampToValueAtTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn exponential_ramp_to_value_at_time(
this: &AudioParam,
value: f32,
end_time: f64,
) -> Result<AudioParam, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioParam" , js_name = linearRampToValueAtTime ) ]
#[doc = "The `linearRampToValueAtTime()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn linear_ramp_to_value_at_time(
this: &AudioParam,
value: f32,
end_time: f64,
) -> Result<AudioParam, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioParam" , js_name = setTargetAtTime ) ]
#[doc = "The `setTargetAtTime()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/setTargetAtTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn set_target_at_time(
this: &AudioParam,
target: f32,
start_time: f64,
time_constant: f64,
) -> Result<AudioParam, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioParam" , js_name = setValueAtTime ) ]
#[doc = "The `setValueAtTime()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/setValueAtTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn set_value_at_time(
this: &AudioParam,
value: f32,
start_time: f64,
) -> Result<AudioParam, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioParam" , js_name = setValueCurveAtTime ) ]
#[doc = "The `setValueCurveAtTime()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/setValueCurveAtTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`*"]
pub fn set_value_curve_at_time(
this: &AudioParam,
values: &mut [f32],
start_time: f64,
duration: f64,
) -> Result<AudioParam, JsValue>;
}

View File

@ -0,0 +1,14 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioParamMap , typescript_type = "AudioParamMap" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioParamMap` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioParamMap)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParamMap`*"]
pub type AudioParamMap;
}

View File

@ -0,0 +1,37 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = Event , extends = :: js_sys :: Object , js_name = AudioProcessingEvent , typescript_type = "AudioProcessingEvent" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioProcessingEvent` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioProcessingEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioProcessingEvent`*"]
pub type AudioProcessingEvent;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioProcessingEvent" , js_name = playbackTime ) ]
#[doc = "Getter for the `playbackTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioProcessingEvent/playbackTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioProcessingEvent`*"]
pub fn playback_time(this: &AudioProcessingEvent) -> f64;
#[cfg(feature = "AudioBuffer")]
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "AudioProcessingEvent" , js_name = inputBuffer ) ]
#[doc = "Getter for the `inputBuffer` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioProcessingEvent/inputBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioProcessingEvent`*"]
pub fn input_buffer(this: &AudioProcessingEvent) -> Result<AudioBuffer, JsValue>;
#[cfg(feature = "AudioBuffer")]
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "AudioProcessingEvent" , js_name = outputBuffer ) ]
#[doc = "Getter for the `outputBuffer` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioProcessingEvent/outputBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioProcessingEvent`*"]
pub fn output_buffer(this: &AudioProcessingEvent) -> Result<AudioBuffer, JsValue>;
}

View File

@ -0,0 +1,63 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioScheduledSourceNode , typescript_type = "AudioScheduledSourceNode" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioScheduledSourceNode` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioScheduledSourceNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioScheduledSourceNode`*"]
#[deprecated(note = "doesn't exist in Safari, use parent class methods instead")]
pub type AudioScheduledSourceNode;
#[deprecated(note = "doesn't exist in Safari, use parent class methods instead")]
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioScheduledSourceNode" , js_name = onended ) ]
#[doc = "Getter for the `onended` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioScheduledSourceNode/onended)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioScheduledSourceNode`*"]
pub fn onended(this: &AudioScheduledSourceNode) -> Option<::js_sys::Function>;
#[deprecated(note = "doesn't exist in Safari, use parent class methods instead")]
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioScheduledSourceNode" , js_name = onended ) ]
#[doc = "Setter for the `onended` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioScheduledSourceNode/onended)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioScheduledSourceNode`*"]
pub fn set_onended(this: &AudioScheduledSourceNode, value: Option<&::js_sys::Function>);
#[deprecated(note = "doesn't exist in Safari, use parent class methods instead")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioScheduledSourceNode" , js_name = start ) ]
#[doc = "The `start()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioScheduledSourceNode/start)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioScheduledSourceNode`*"]
pub fn start(this: &AudioScheduledSourceNode) -> Result<(), JsValue>;
#[deprecated(note = "doesn't exist in Safari, use parent class methods instead")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioScheduledSourceNode" , js_name = start ) ]
#[doc = "The `start()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioScheduledSourceNode/start)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioScheduledSourceNode`*"]
pub fn start_with_when(this: &AudioScheduledSourceNode, when: f64) -> Result<(), JsValue>;
#[deprecated(note = "doesn't exist in Safari, use parent class methods instead")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioScheduledSourceNode" , js_name = stop ) ]
#[doc = "The `stop()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioScheduledSourceNode/stop)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioScheduledSourceNode`*"]
pub fn stop(this: &AudioScheduledSourceNode) -> Result<(), JsValue>;
#[deprecated(note = "doesn't exist in Safari, use parent class methods instead")]
# [ wasm_bindgen ( catch , method , structural , js_class = "AudioScheduledSourceNode" , js_name = stop ) ]
#[doc = "The `stop()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioScheduledSourceNode/stop)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioScheduledSourceNode`*"]
pub fn stop_with_when(this: &AudioScheduledSourceNode, when: f64) -> Result<(), JsValue>;
}

View File

@ -0,0 +1,14 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = MediaStreamTrack , extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioStreamTrack , typescript_type = "AudioStreamTrack" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioStreamTrack` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioStreamTrack)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioStreamTrack`*"]
pub type AudioStreamTrack;
}

View File

@ -0,0 +1,56 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioTrack , typescript_type = "AudioTrack" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioTrack` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
pub type AudioTrack;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrack" , js_name = id ) ]
#[doc = "Getter for the `id` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/id)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
pub fn id(this: &AudioTrack) -> String;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrack" , js_name = kind ) ]
#[doc = "Getter for the `kind` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/kind)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
pub fn kind(this: &AudioTrack) -> String;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrack" , js_name = label ) ]
#[doc = "Getter for the `label` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/label)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
pub fn label(this: &AudioTrack) -> String;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrack" , js_name = language ) ]
#[doc = "Getter for the `language` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/language)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
pub fn language(this: &AudioTrack) -> String;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrack" , js_name = enabled ) ]
#[doc = "Getter for the `enabled` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/enabled)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
pub fn enabled(this: &AudioTrack) -> bool;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioTrack" , js_name = enabled ) ]
#[doc = "Setter for the `enabled` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/enabled)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`*"]
pub fn set_enabled(this: &AudioTrack, value: bool);
}

View File

@ -0,0 +1,79 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioTrackList , typescript_type = "AudioTrackList" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioTrackList` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub type AudioTrackList;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrackList" , js_name = length ) ]
#[doc = "Getter for the `length` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/length)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub fn length(this: &AudioTrackList) -> u32;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrackList" , js_name = onchange ) ]
#[doc = "Getter for the `onchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/onchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub fn onchange(this: &AudioTrackList) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioTrackList" , js_name = onchange ) ]
#[doc = "Setter for the `onchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/onchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub fn set_onchange(this: &AudioTrackList, value: Option<&::js_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrackList" , js_name = onaddtrack ) ]
#[doc = "Getter for the `onaddtrack` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/onaddtrack)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub fn onaddtrack(this: &AudioTrackList) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioTrackList" , js_name = onaddtrack ) ]
#[doc = "Setter for the `onaddtrack` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/onaddtrack)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub fn set_onaddtrack(this: &AudioTrackList, value: Option<&::js_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrackList" , js_name = onremovetrack ) ]
#[doc = "Getter for the `onremovetrack` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/onremovetrack)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub fn onremovetrack(this: &AudioTrackList) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioTrackList" , js_name = onremovetrack ) ]
#[doc = "Setter for the `onremovetrack` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/onremovetrack)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrackList`*"]
pub fn set_onremovetrack(this: &AudioTrackList, value: Option<&::js_sys::Function>);
#[cfg(feature = "AudioTrack")]
# [ wasm_bindgen ( method , structural , js_class = "AudioTrackList" , js_name = getTrackById ) ]
#[doc = "The `getTrackById()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/getTrackById)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`, `AudioTrackList`*"]
pub fn get_track_by_id(this: &AudioTrackList, id: &str) -> Option<AudioTrack>;
#[cfg(feature = "AudioTrack")]
#[wasm_bindgen(method, structural, js_class = "AudioTrackList", indexing_getter)]
#[doc = "Indexing getter."]
#[doc = ""]
#[doc = ""]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioTrack`, `AudioTrackList`*"]
pub fn get(this: &AudioTrackList, index: u32) -> Option<AudioTrack>;
}

View File

@ -0,0 +1,14 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = Worklet , extends = :: js_sys :: Object , js_name = AudioWorklet , typescript_type = "AudioWorklet" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioWorklet` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorklet)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorklet`*"]
pub type AudioWorklet;
}

View File

@ -0,0 +1,46 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = WorkletGlobalScope , extends = :: js_sys :: Object , js_name = AudioWorkletGlobalScope , typescript_type = "AudioWorkletGlobalScope" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioWorkletGlobalScope` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletGlobalScope`*"]
pub type AudioWorkletGlobalScope;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioWorkletGlobalScope" , js_name = currentFrame ) ]
#[doc = "Getter for the `currentFrame` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope/currentFrame)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletGlobalScope`*"]
pub fn current_frame(this: &AudioWorkletGlobalScope) -> f64;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioWorkletGlobalScope" , js_name = currentTime ) ]
#[doc = "Getter for the `currentTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope/currentTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletGlobalScope`*"]
pub fn current_time(this: &AudioWorkletGlobalScope) -> f64;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioWorkletGlobalScope" , js_name = sampleRate ) ]
#[doc = "Getter for the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope/sampleRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletGlobalScope`*"]
pub fn sample_rate(this: &AudioWorkletGlobalScope) -> f32;
# [ wasm_bindgen ( method , structural , js_class = "AudioWorkletGlobalScope" , js_name = registerProcessor ) ]
#[doc = "The `registerProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope/registerProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletGlobalScope`*"]
pub fn register_processor(
this: &AudioWorkletGlobalScope,
name: &str,
processor_ctor: &::js_sys::Function,
);
}

View File

@ -0,0 +1,64 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = AudioWorkletNode , typescript_type = "AudioWorkletNode" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioWorkletNode` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`*"]
pub type AudioWorkletNode;
#[cfg(feature = "AudioParamMap")]
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "AudioWorkletNode" , js_name = parameters ) ]
#[doc = "Getter for the `parameters` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/parameters)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParamMap`, `AudioWorkletNode`*"]
pub fn parameters(this: &AudioWorkletNode) -> Result<AudioParamMap, JsValue>;
#[cfg(feature = "MessagePort")]
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "AudioWorkletNode" , js_name = port ) ]
#[doc = "Getter for the `port` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/port)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`, `MessagePort`*"]
pub fn port(this: &AudioWorkletNode) -> Result<MessagePort, JsValue>;
# [ wasm_bindgen ( structural , method , getter , js_class = "AudioWorkletNode" , js_name = onprocessorerror ) ]
#[doc = "Getter for the `onprocessorerror` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/onprocessorerror)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`*"]
pub fn onprocessorerror(this: &AudioWorkletNode) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "AudioWorkletNode" , js_name = onprocessorerror ) ]
#[doc = "Setter for the `onprocessorerror` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/onprocessorerror)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`*"]
pub fn set_onprocessorerror(this: &AudioWorkletNode, value: Option<&::js_sys::Function>);
#[cfg(feature = "BaseAudioContext")]
#[wasm_bindgen(catch, constructor, js_class = "AudioWorkletNode")]
#[doc = "The `new AudioWorkletNode(..)` constructor, creating a new instance of `AudioWorkletNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/AudioWorkletNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`, `BaseAudioContext`*"]
pub fn new(context: &BaseAudioContext, name: &str) -> Result<AudioWorkletNode, JsValue>;
#[cfg(all(feature = "AudioWorkletNodeOptions", feature = "BaseAudioContext",))]
#[wasm_bindgen(catch, constructor, js_class = "AudioWorkletNode")]
#[doc = "The `new AudioWorkletNode(..)` constructor, creating a new instance of `AudioWorkletNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletNode/AudioWorkletNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNode`, `AudioWorkletNodeOptions`, `BaseAudioContext`*"]
pub fn new_with_options(
context: &BaseAudioContext,
name: &str,
options: &AudioWorkletNodeOptions,
) -> Result<AudioWorkletNode, JsValue>;
}

View File

@ -0,0 +1,143 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioWorkletNodeOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioWorkletNodeOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"]
pub type AudioWorkletNodeOptions;
}
impl AudioWorkletNodeOptions {
#[doc = "Construct a new `AudioWorkletNodeOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `channelCount` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"]
pub fn channel_count(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCount"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelCountMode")]
#[doc = "Change the `channelCountMode` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`, `ChannelCountMode`*"]
pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCountMode"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelInterpretation")]
#[doc = "Change the `channelInterpretation` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`, `ChannelInterpretation`*"]
pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelInterpretation"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `numberOfInputs` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"]
pub fn number_of_inputs(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("numberOfInputs"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `numberOfOutputs` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"]
pub fn number_of_outputs(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("numberOfOutputs"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `outputChannelCount` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"]
pub fn output_channel_count(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("outputChannelCount"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `processorOptions` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`*"]
pub fn processor_options(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("processorOptions"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,39 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AudioWorkletProcessor , typescript_type = "AudioWorkletProcessor" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioWorkletProcessor` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletProcessor`*"]
pub type AudioWorkletProcessor;
#[cfg(feature = "MessagePort")]
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "AudioWorkletProcessor" , js_name = port ) ]
#[doc = "Getter for the `port` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor/port)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletProcessor`, `MessagePort`*"]
pub fn port(this: &AudioWorkletProcessor) -> Result<MessagePort, JsValue>;
#[wasm_bindgen(catch, constructor, js_class = "AudioWorkletProcessor")]
#[doc = "The `new AudioWorkletProcessor(..)` constructor, creating a new instance of `AudioWorkletProcessor`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor/AudioWorkletProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletProcessor`*"]
pub fn new() -> Result<AudioWorkletProcessor, JsValue>;
#[cfg(feature = "AudioWorkletNodeOptions")]
#[wasm_bindgen(catch, constructor, js_class = "AudioWorkletProcessor")]
#[doc = "The `new AudioWorkletProcessor(..)` constructor, creating a new instance of `AudioWorkletProcessor`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor/AudioWorkletProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorkletNodeOptions`, `AudioWorkletProcessor`*"]
pub fn new_with_options(
options: &AudioWorkletNodeOptions,
) -> Result<AudioWorkletProcessor, JsValue>;
}

View File

@ -0,0 +1,35 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AuthenticationExtensionsClientInputs ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AuthenticationExtensionsClientInputs` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
pub type AuthenticationExtensionsClientInputs;
}
impl AuthenticationExtensionsClientInputs {
#[doc = "Construct a new `AuthenticationExtensionsClientInputs`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `appid` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`*"]
pub fn appid(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("appid"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,35 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AuthenticationExtensionsClientOutputs ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AuthenticationExtensionsClientOutputs` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"]
pub type AuthenticationExtensionsClientOutputs;
}
impl AuthenticationExtensionsClientOutputs {
#[doc = "Construct a new `AuthenticationExtensionsClientOutputs`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `appid` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientOutputs`*"]
pub fn appid(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("appid"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,35 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AuthenticatorResponse , extends = :: js_sys :: Object , js_name = AuthenticatorAssertionResponse , typescript_type = "AuthenticatorAssertionResponse" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AuthenticatorAssertionResponse` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponse`*"]
pub type AuthenticatorAssertionResponse;
# [ wasm_bindgen ( structural , method , getter , js_class = "AuthenticatorAssertionResponse" , js_name = authenticatorData ) ]
#[doc = "Getter for the `authenticatorData` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponse`*"]
pub fn authenticator_data(this: &AuthenticatorAssertionResponse) -> ::js_sys::ArrayBuffer;
# [ wasm_bindgen ( structural , method , getter , js_class = "AuthenticatorAssertionResponse" , js_name = signature ) ]
#[doc = "Getter for the `signature` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/signature)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponse`*"]
pub fn signature(this: &AuthenticatorAssertionResponse) -> ::js_sys::ArrayBuffer;
# [ wasm_bindgen ( structural , method , getter , js_class = "AuthenticatorAssertionResponse" , js_name = userHandle ) ]
#[doc = "Getter for the `userHandle` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/userHandle)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAssertionResponse`*"]
pub fn user_handle(this: &AuthenticatorAssertionResponse) -> Option<::js_sys::ArrayBuffer>;
}

View File

@ -0,0 +1,11 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AuthenticatorAttachment` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttachment`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AuthenticatorAttachment {
Platform = "platform",
CrossPlatform = "cross-platform",
}

View File

@ -0,0 +1,21 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AuthenticatorResponse , extends = :: js_sys :: Object , js_name = AuthenticatorAttestationResponse , typescript_type = "AuthenticatorAttestationResponse" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AuthenticatorAttestationResponse` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponse`*"]
pub type AuthenticatorAttestationResponse;
# [ wasm_bindgen ( structural , method , getter , js_class = "AuthenticatorAttestationResponse" , js_name = attestationObject ) ]
#[doc = "Getter for the `attestationObject` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse/attestationObject)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttestationResponse`*"]
pub fn attestation_object(this: &AuthenticatorAttestationResponse) -> ::js_sys::ArrayBuffer;
}

View File

@ -0,0 +1,21 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AuthenticatorResponse , typescript_type = "AuthenticatorResponse" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AuthenticatorResponse` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorResponse)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorResponse`*"]
pub type AuthenticatorResponse;
# [ wasm_bindgen ( structural , method , getter , js_class = "AuthenticatorResponse" , js_name = clientDataJSON ) ]
#[doc = "Getter for the `clientDataJSON` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorResponse/clientDataJSON)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorResponse`*"]
pub fn client_data_json(this: &AuthenticatorResponse) -> ::js_sys::ArrayBuffer;
}

View File

@ -0,0 +1,75 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AuthenticatorSelectionCriteria ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AuthenticatorSelectionCriteria` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
pub type AuthenticatorSelectionCriteria;
}
impl AuthenticatorSelectionCriteria {
#[doc = "Construct a new `AuthenticatorSelectionCriteria`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(feature = "AuthenticatorAttachment")]
#[doc = "Change the `authenticatorAttachment` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttachment`, `AuthenticatorSelectionCriteria`*"]
pub fn authenticator_attachment(&mut self, val: AuthenticatorAttachment) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("authenticatorAttachment"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `requireResidentKey` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
pub fn require_resident_key(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("requireResidentKey"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "UserVerificationRequirement")]
#[doc = "Change the `userVerification` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `UserVerificationRequirement`*"]
pub fn user_verification(&mut self, val: UserVerificationRequirement) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("userVerification"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,12 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AuthenticatorTransport` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AuthenticatorTransport`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AuthenticatorTransport {
Usb = "usb",
Nfc = "nfc",
Ble = "ble",
}

View File

@ -0,0 +1,10 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `AutoKeyword` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AutoKeyword`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AutoKeyword {
Auto = "auto",
}

View File

@ -0,0 +1,90 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = AutocompleteInfo ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AutocompleteInfo` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
pub type AutocompleteInfo;
}
impl AutocompleteInfo {
#[doc = "Construct a new `AutocompleteInfo`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `addressType` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
pub fn address_type(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("addressType"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `contactType` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
pub fn contact_type(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("contactType"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `fieldName` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
pub fn field_name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("fieldName"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `section` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AutocompleteInfo`*"]
pub fn section(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("section"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,28 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BarProp , typescript_type = "BarProp" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BarProp` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BarProp)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BarProp`*"]
pub type BarProp;
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "BarProp" , js_name = visible ) ]
#[doc = "Getter for the `visible` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BarProp/visible)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BarProp`*"]
pub fn visible(this: &BarProp) -> Result<bool, JsValue>;
# [ wasm_bindgen ( structural , catch , method , setter , js_class = "BarProp" , js_name = visible ) ]
#[doc = "Setter for the `visible` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BarProp/visible)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BarProp`*"]
pub fn set_visible(this: &BarProp, value: bool) -> Result<(), JsValue>;
}

View File

@ -0,0 +1,395 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = BaseAudioContext , typescript_type = "BaseAudioContext" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BaseAudioContext` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
pub type BaseAudioContext;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "AudioDestinationNode")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BaseAudioContext" , js_name = destination ) ]
#[doc = "Getter for the `destination` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/destination)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioDestinationNode`, `BaseAudioContext`*"]
pub fn destination(this: &BaseAudioContext) -> AudioDestinationNode;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BaseAudioContext" , js_name = sampleRate ) ]
#[doc = "Getter for the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/sampleRate)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn sample_rate(this: &BaseAudioContext) -> f32;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BaseAudioContext" , js_name = currentTime ) ]
#[doc = "Getter for the `currentTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/currentTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn current_time(this: &BaseAudioContext) -> f64;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "AudioListener")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BaseAudioContext" , js_name = listener ) ]
#[doc = "Getter for the `listener` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/listener)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioListener`, `BaseAudioContext`*"]
pub fn listener(this: &BaseAudioContext) -> AudioListener;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "AudioContextState")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BaseAudioContext" , js_name = state ) ]
#[doc = "Getter for the `state` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/state)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioContextState`, `BaseAudioContext`*"]
pub fn state(this: &BaseAudioContext) -> AudioContextState;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "AudioWorklet")]
# [ wasm_bindgen ( structural , catch , method , getter , js_class = "BaseAudioContext" , js_name = audioWorklet ) ]
#[doc = "Getter for the `audioWorklet` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/audioWorklet)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioWorklet`, `BaseAudioContext`*"]
pub fn audio_worklet(this: &BaseAudioContext) -> Result<AudioWorklet, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BaseAudioContext" , js_name = onstatechange ) ]
#[doc = "Getter for the `onstatechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/onstatechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn onstatechange(this: &BaseAudioContext) -> Option<::js_sys::Function>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( structural , method , setter , js_class = "BaseAudioContext" , js_name = onstatechange ) ]
#[doc = "Setter for the `onstatechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/onstatechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn set_onstatechange(this: &BaseAudioContext, value: Option<&::js_sys::Function>);
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "AnalyserNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createAnalyser ) ]
#[doc = "The `createAnalyser()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createAnalyser)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AnalyserNode`, `BaseAudioContext`*"]
pub fn create_analyser(this: &BaseAudioContext) -> Result<AnalyserNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "BiquadFilterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createBiquadFilter ) ]
#[doc = "The `createBiquadFilter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBiquadFilter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `BiquadFilterNode`*"]
pub fn create_biquad_filter(this: &BaseAudioContext) -> Result<BiquadFilterNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "AudioBuffer")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createBuffer ) ]
#[doc = "The `createBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `BaseAudioContext`*"]
pub fn create_buffer(
this: &BaseAudioContext,
number_of_channels: u32,
length: u32,
sample_rate: f32,
) -> Result<AudioBuffer, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "AudioBufferSourceNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createBufferSource ) ]
#[doc = "The `createBufferSource()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBufferSource)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `BaseAudioContext`*"]
pub fn create_buffer_source(this: &BaseAudioContext) -> Result<AudioBufferSourceNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ChannelMergerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createChannelMerger ) ]
#[doc = "The `createChannelMerger()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createChannelMerger)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ChannelMergerNode`*"]
pub fn create_channel_merger(this: &BaseAudioContext) -> Result<ChannelMergerNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ChannelMergerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createChannelMerger ) ]
#[doc = "The `createChannelMerger()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createChannelMerger)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ChannelMergerNode`*"]
pub fn create_channel_merger_with_number_of_inputs(
this: &BaseAudioContext,
number_of_inputs: u32,
) -> Result<ChannelMergerNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ChannelSplitterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createChannelSplitter ) ]
#[doc = "The `createChannelSplitter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createChannelSplitter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ChannelSplitterNode`*"]
pub fn create_channel_splitter(this: &BaseAudioContext)
-> Result<ChannelSplitterNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ChannelSplitterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createChannelSplitter ) ]
#[doc = "The `createChannelSplitter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createChannelSplitter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ChannelSplitterNode`*"]
pub fn create_channel_splitter_with_number_of_outputs(
this: &BaseAudioContext,
number_of_outputs: u32,
) -> Result<ChannelSplitterNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ConstantSourceNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createConstantSource ) ]
#[doc = "The `createConstantSource()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createConstantSource)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ConstantSourceNode`*"]
pub fn create_constant_source(this: &BaseAudioContext) -> Result<ConstantSourceNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ConvolverNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createConvolver ) ]
#[doc = "The `createConvolver()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createConvolver)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ConvolverNode`*"]
pub fn create_convolver(this: &BaseAudioContext) -> Result<ConvolverNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "DelayNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createDelay ) ]
#[doc = "The `createDelay()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createDelay)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `DelayNode`*"]
pub fn create_delay(this: &BaseAudioContext) -> Result<DelayNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "DelayNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createDelay ) ]
#[doc = "The `createDelay()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createDelay)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `DelayNode`*"]
pub fn create_delay_with_max_delay_time(
this: &BaseAudioContext,
max_delay_time: f64,
) -> Result<DelayNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "DynamicsCompressorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createDynamicsCompressor ) ]
#[doc = "The `createDynamicsCompressor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createDynamicsCompressor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `DynamicsCompressorNode`*"]
pub fn create_dynamics_compressor(
this: &BaseAudioContext,
) -> Result<DynamicsCompressorNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "GainNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createGain ) ]
#[doc = "The `createGain()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createGain)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `GainNode`*"]
pub fn create_gain(this: &BaseAudioContext) -> Result<GainNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "IirFilterNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createIIRFilter ) ]
#[doc = "The `createIIRFilter()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createIIRFilter)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `IirFilterNode`*"]
pub fn create_iir_filter(
this: &BaseAudioContext,
feedforward: &::wasm_bindgen::JsValue,
feedback: &::wasm_bindgen::JsValue,
) -> Result<IirFilterNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "OscillatorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createOscillator ) ]
#[doc = "The `createOscillator()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createOscillator)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `OscillatorNode`*"]
pub fn create_oscillator(this: &BaseAudioContext) -> Result<OscillatorNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "PannerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createPanner ) ]
#[doc = "The `createPanner()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createPanner)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `PannerNode`*"]
pub fn create_panner(this: &BaseAudioContext) -> Result<PannerNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "PeriodicWave")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createPeriodicWave ) ]
#[doc = "The `createPeriodicWave()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createPeriodicWave)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `PeriodicWave`*"]
pub fn create_periodic_wave(
this: &BaseAudioContext,
real: &mut [f32],
imag: &mut [f32],
) -> Result<PeriodicWave, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createPeriodicWave ) ]
#[doc = "The `createPeriodicWave()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createPeriodicWave)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"]
pub fn create_periodic_wave_with_constraints(
this: &BaseAudioContext,
real: &mut [f32],
imag: &mut [f32],
constraints: &PeriodicWaveConstraints,
) -> Result<PeriodicWave, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor(this: &BaseAudioContext)
-> Result<ScriptProcessorNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor_with_buffer_size(
this: &BaseAudioContext,
buffer_size: u32,
) -> Result<ScriptProcessorNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels(
this: &BaseAudioContext,
buffer_size: u32,
number_of_input_channels: u32,
) -> Result<ScriptProcessorNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "ScriptProcessorNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createScriptProcessor ) ]
#[doc = "The `createScriptProcessor()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `ScriptProcessorNode`*"]
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels_and_number_of_output_channels(
this: &BaseAudioContext,
buffer_size: u32,
number_of_input_channels: u32,
number_of_output_channels: u32,
) -> Result<ScriptProcessorNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "StereoPannerNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createStereoPanner ) ]
#[doc = "The `createStereoPanner()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createStereoPanner)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `StereoPannerNode`*"]
pub fn create_stereo_panner(this: &BaseAudioContext) -> Result<StereoPannerNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
#[cfg(feature = "WaveShaperNode")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = createWaveShaper ) ]
#[doc = "The `createWaveShaper()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createWaveShaper)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `WaveShaperNode`*"]
pub fn create_wave_shaper(this: &BaseAudioContext) -> Result<WaveShaperNode, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = decodeAudioData ) ]
#[doc = "The `decodeAudioData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/decodeAudioData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn decode_audio_data(
this: &BaseAudioContext,
audio_data: &::js_sys::ArrayBuffer,
) -> Result<::js_sys::Promise, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = decodeAudioData ) ]
#[doc = "The `decodeAudioData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/decodeAudioData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn decode_audio_data_with_success_callback(
this: &BaseAudioContext,
audio_data: &::js_sys::ArrayBuffer,
success_callback: &::js_sys::Function,
) -> Result<::js_sys::Promise, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = decodeAudioData ) ]
#[doc = "The `decodeAudioData()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/decodeAudioData)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn decode_audio_data_with_success_callback_and_error_callback(
this: &BaseAudioContext,
audio_data: &::js_sys::ArrayBuffer,
success_callback: &::js_sys::Function,
error_callback: &::js_sys::Function,
) -> Result<::js_sys::Promise, JsValue>;
#[deprecated(note = "doesn't exist in Safari, use `AudioContext` instead now")]
# [ wasm_bindgen ( catch , method , structural , js_class = "BaseAudioContext" , js_name = resume ) ]
#[doc = "The `resume()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/resume)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`*"]
pub fn resume(this: &BaseAudioContext) -> Result<::js_sys::Promise, JsValue>;
}

View File

@ -0,0 +1,102 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BaseComputedKeyframe ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BaseComputedKeyframe` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
pub type BaseComputedKeyframe;
}
impl BaseComputedKeyframe {
#[doc = "Construct a new `BaseComputedKeyframe`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(feature = "CompositeOperation")]
#[doc = "Change the `composite` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`, `CompositeOperation`*"]
pub fn composite(&mut self, val: Option<CompositeOperation>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composite"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `easing` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
pub fn easing(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `offset` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
pub fn offset(&mut self, val: Option<f64>) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `simulateComputeValuesFailure` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
pub fn simulate_compute_values_failure(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("simulateComputeValuesFailure"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `computedOffset` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseComputedKeyframe`*"]
pub fn computed_offset(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("computedOffset"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,85 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BaseKeyframe ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BaseKeyframe` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"]
pub type BaseKeyframe;
}
impl BaseKeyframe {
#[doc = "Construct a new `BaseKeyframe`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(feature = "CompositeOperation")]
#[doc = "Change the `composite` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`, `CompositeOperation`*"]
pub fn composite(&mut self, val: Option<CompositeOperation>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composite"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `easing` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"]
pub fn easing(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `offset` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"]
pub fn offset(&mut self, val: Option<f64>) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `simulateComputeValuesFailure` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseKeyframe`*"]
pub fn simulate_compute_values_failure(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("simulateComputeValuesFailure"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,67 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BasePropertyIndexedKeyframe ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BasePropertyIndexedKeyframe` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"]
pub type BasePropertyIndexedKeyframe;
}
impl BasePropertyIndexedKeyframe {
#[doc = "Construct a new `BasePropertyIndexedKeyframe`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `composite` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"]
pub fn composite(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composite"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `easing` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"]
pub fn easing(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("easing"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `offset` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasePropertyIndexedKeyframe`*"]
pub fn offset(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,56 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BasicCardRequest ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BasicCardRequest` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"]
pub type BasicCardRequest;
}
impl BasicCardRequest {
#[doc = "Construct a new `BasicCardRequest`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `supportedNetworks` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"]
pub fn supported_networks(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("supportedNetworks"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `supportedTypes` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardRequest`*"]
pub fn supported_types(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("supportedTypes"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,126 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BasicCardResponse ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BasicCardResponse` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
pub type BasicCardResponse;
}
impl BasicCardResponse {
#[doc = "Construct a new `BasicCardResponse`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
pub fn new(card_number: &str) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.card_number(card_number);
ret
}
#[cfg(feature = "PaymentAddress")]
#[doc = "Change the `billingAddress` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`, `PaymentAddress`*"]
pub fn billing_address(&mut self, val: Option<&PaymentAddress>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("billingAddress"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `cardNumber` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
pub fn card_number(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("cardNumber"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `cardSecurityCode` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
pub fn card_security_code(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("cardSecurityCode"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `cardholderName` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
pub fn cardholder_name(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("cardholderName"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `expiryMonth` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
pub fn expiry_month(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("expiryMonth"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `expiryYear` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
pub fn expiry_year(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("expiryYear"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,12 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `BasicCardType` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BasicCardType`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BasicCardType {
Credit = "credit",
Debit = "debit",
Prepaid = "prepaid",
}

View File

@ -0,0 +1,98 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = BatteryManager , typescript_type = "BatteryManager" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BatteryManager` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub type BatteryManager;
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = charging ) ]
#[doc = "Getter for the `charging` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/charging)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn charging(this: &BatteryManager) -> bool;
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = chargingTime ) ]
#[doc = "Getter for the `chargingTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/chargingTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn charging_time(this: &BatteryManager) -> f64;
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = dischargingTime ) ]
#[doc = "Getter for the `dischargingTime` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/dischargingTime)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn discharging_time(this: &BatteryManager) -> f64;
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = level ) ]
#[doc = "Getter for the `level` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/level)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn level(this: &BatteryManager) -> f64;
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = onchargingchange ) ]
#[doc = "Getter for the `onchargingchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn onchargingchange(this: &BatteryManager) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "BatteryManager" , js_name = onchargingchange ) ]
#[doc = "Setter for the `onchargingchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn set_onchargingchange(this: &BatteryManager, value: Option<&::js_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = onchargingtimechange ) ]
#[doc = "Getter for the `onchargingtimechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingtimechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn onchargingtimechange(this: &BatteryManager) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "BatteryManager" , js_name = onchargingtimechange ) ]
#[doc = "Setter for the `onchargingtimechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingtimechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn set_onchargingtimechange(this: &BatteryManager, value: Option<&::js_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = ondischargingtimechange ) ]
#[doc = "Getter for the `ondischargingtimechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/ondischargingtimechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn ondischargingtimechange(this: &BatteryManager) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "BatteryManager" , js_name = ondischargingtimechange ) ]
#[doc = "Setter for the `ondischargingtimechange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/ondischargingtimechange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn set_ondischargingtimechange(this: &BatteryManager, value: Option<&::js_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "BatteryManager" , js_name = onlevelchange ) ]
#[doc = "Getter for the `onlevelchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onlevelchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn onlevelchange(this: &BatteryManager) -> Option<::js_sys::Function>;
# [ wasm_bindgen ( structural , method , setter , js_class = "BatteryManager" , js_name = onlevelchange ) ]
#[doc = "Setter for the `onlevelchange` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onlevelchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
pub fn set_onlevelchange(this: &BatteryManager, value: Option<&::js_sys::Function>);
}

View File

@ -0,0 +1,28 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = Event , extends = :: js_sys :: Object , js_name = BeforeUnloadEvent , typescript_type = "BeforeUnloadEvent" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BeforeUnloadEvent` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BeforeUnloadEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BeforeUnloadEvent`*"]
pub type BeforeUnloadEvent;
# [ wasm_bindgen ( structural , method , getter , js_class = "BeforeUnloadEvent" , js_name = returnValue ) ]
#[doc = "Getter for the `returnValue` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BeforeUnloadEvent/returnValue)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BeforeUnloadEvent`*"]
pub fn return_value(this: &BeforeUnloadEvent) -> String;
# [ wasm_bindgen ( structural , method , setter , js_class = "BeforeUnloadEvent" , js_name = returnValue ) ]
#[doc = "Setter for the `returnValue` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BeforeUnloadEvent/returnValue)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BeforeUnloadEvent`*"]
pub fn set_return_value(this: &BeforeUnloadEvent, value: &str);
}

View File

@ -0,0 +1,11 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `BinaryType` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BinaryType`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BinaryType {
Blob = "blob",
Arraybuffer = "arraybuffer",
}

View File

@ -0,0 +1,93 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = AudioNode , extends = EventTarget , extends = :: js_sys :: Object , js_name = BiquadFilterNode , typescript_type = "BiquadFilterNode" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BiquadFilterNode` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterNode`*"]
pub type BiquadFilterNode;
#[cfg(feature = "BiquadFilterType")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BiquadFilterNode" , js_name = type ) ]
#[doc = "Getter for the `type` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/type)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterNode`, `BiquadFilterType`*"]
pub fn type_(this: &BiquadFilterNode) -> BiquadFilterType;
#[cfg(feature = "BiquadFilterType")]
# [ wasm_bindgen ( structural , method , setter , js_class = "BiquadFilterNode" , js_name = type ) ]
#[doc = "Setter for the `type` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/type)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterNode`, `BiquadFilterType`*"]
pub fn set_type(this: &BiquadFilterNode, value: BiquadFilterType);
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BiquadFilterNode" , js_name = frequency ) ]
#[doc = "Getter for the `frequency` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/frequency)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`, `BiquadFilterNode`*"]
pub fn frequency(this: &BiquadFilterNode) -> AudioParam;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BiquadFilterNode" , js_name = detune ) ]
#[doc = "Getter for the `detune` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/detune)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`, `BiquadFilterNode`*"]
pub fn detune(this: &BiquadFilterNode) -> AudioParam;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BiquadFilterNode" , js_name = Q ) ]
#[doc = "Getter for the `Q` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/Q)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`, `BiquadFilterNode`*"]
pub fn q(this: &BiquadFilterNode) -> AudioParam;
#[cfg(feature = "AudioParam")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BiquadFilterNode" , js_name = gain ) ]
#[doc = "Getter for the `gain` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/gain)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioParam`, `BiquadFilterNode`*"]
pub fn gain(this: &BiquadFilterNode) -> AudioParam;
#[cfg(feature = "BaseAudioContext")]
#[wasm_bindgen(catch, constructor, js_class = "BiquadFilterNode")]
#[doc = "The `new BiquadFilterNode(..)` constructor, creating a new instance of `BiquadFilterNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/BiquadFilterNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `BiquadFilterNode`*"]
pub fn new(context: &BaseAudioContext) -> Result<BiquadFilterNode, JsValue>;
#[cfg(all(feature = "BaseAudioContext", feature = "BiquadFilterOptions",))]
#[wasm_bindgen(catch, constructor, js_class = "BiquadFilterNode")]
#[doc = "The `new BiquadFilterNode(..)` constructor, creating a new instance of `BiquadFilterNode`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/BiquadFilterNode)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BaseAudioContext`, `BiquadFilterNode`, `BiquadFilterOptions`*"]
pub fn new_with_options(
context: &BaseAudioContext,
options: &BiquadFilterOptions,
) -> Result<BiquadFilterNode, JsValue>;
# [ wasm_bindgen ( method , structural , js_class = "BiquadFilterNode" , js_name = getFrequencyResponse ) ]
#[doc = "The `getFrequencyResponse()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode/getFrequencyResponse)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterNode`*"]
pub fn get_frequency_response(
this: &BiquadFilterNode,
frequency_hz: &mut [f32],
mag_response: &mut [f32],
phase_response: &mut [f32],
);
}

View File

@ -0,0 +1,146 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BiquadFilterOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BiquadFilterOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"]
pub type BiquadFilterOptions;
}
impl BiquadFilterOptions {
#[doc = "Construct a new `BiquadFilterOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `channelCount` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"]
pub fn channel_count(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCount"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelCountMode")]
#[doc = "Change the `channelCountMode` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `ChannelCountMode`*"]
pub fn channel_count_mode(&mut self, val: ChannelCountMode) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelCountMode"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "ChannelInterpretation")]
#[doc = "Change the `channelInterpretation` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `ChannelInterpretation`*"]
pub fn channel_interpretation(&mut self, val: ChannelInterpretation) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("channelInterpretation"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `Q` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"]
pub fn q(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("Q"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `detune` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"]
pub fn detune(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detune"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `frequency` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"]
pub fn frequency(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("frequency"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `gain` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`*"]
pub fn gain(&mut self, val: f32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("gain"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "BiquadFilterType")]
#[doc = "Change the `type` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterOptions`, `BiquadFilterType`*"]
pub fn type_(&mut self, val: BiquadFilterType) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,17 @@
#![allow(unused_imports)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[doc = "The `BiquadFilterType` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BiquadFilterType`*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BiquadFilterType {
Lowpass = "lowpass",
Highpass = "highpass",
Bandpass = "bandpass",
Lowshelf = "lowshelf",
Highshelf = "highshelf",
Peaking = "peaking",
Notch = "notch",
Allpass = "allpass",
}

View File

@ -0,0 +1,222 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = Blob , typescript_type = "Blob" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `Blob` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub type Blob;
# [ wasm_bindgen ( structural , method , getter , js_class = "Blob" , js_name = size ) ]
#[doc = "Getter for the `size` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/size)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn size(this: &Blob) -> f64;
# [ wasm_bindgen ( structural , method , getter , js_class = "Blob" , js_name = type ) ]
#[doc = "Getter for the `type` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/type)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn type_(this: &Blob) -> String;
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn new() -> Result<Blob, JsValue>;
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn new_with_buffer_source_sequence(
blob_parts: &::wasm_bindgen::JsValue,
) -> Result<Blob, JsValue>;
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn new_with_u8_array_sequence(
blob_parts: &::wasm_bindgen::JsValue,
) -> Result<Blob, JsValue>;
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn new_with_blob_sequence(blob_parts: &::wasm_bindgen::JsValue) -> Result<Blob, JsValue>;
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn new_with_str_sequence(blob_parts: &::wasm_bindgen::JsValue) -> Result<Blob, JsValue>;
#[cfg(feature = "BlobPropertyBag")]
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
pub fn new_with_buffer_source_sequence_and_options(
blob_parts: &::wasm_bindgen::JsValue,
options: &BlobPropertyBag,
) -> Result<Blob, JsValue>;
#[cfg(feature = "BlobPropertyBag")]
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
pub fn new_with_u8_array_sequence_and_options(
blob_parts: &::wasm_bindgen::JsValue,
options: &BlobPropertyBag,
) -> Result<Blob, JsValue>;
#[cfg(feature = "BlobPropertyBag")]
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
pub fn new_with_blob_sequence_and_options(
blob_parts: &::wasm_bindgen::JsValue,
options: &BlobPropertyBag,
) -> Result<Blob, JsValue>;
#[cfg(feature = "BlobPropertyBag")]
#[wasm_bindgen(catch, constructor, js_class = "Blob")]
#[doc = "The `new Blob(..)` constructor, creating a new instance of `Blob`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobPropertyBag`*"]
pub fn new_with_str_sequence_and_options(
blob_parts: &::wasm_bindgen::JsValue,
options: &BlobPropertyBag,
) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( method , structural , js_class = "Blob" , js_name = arrayBuffer ) ]
#[doc = "The `arrayBuffer()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/arrayBuffer)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn array_buffer(this: &Blob) -> ::js_sys::Promise;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice(this: &Blob) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_i32(this: &Blob, start: i32) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_f64(this: &Blob, start: f64) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_i32_and_i32(this: &Blob, start: i32, end: i32) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_f64_and_i32(this: &Blob, start: f64, end: i32) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_i32_and_f64(this: &Blob, start: i32, end: f64) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_f64_and_f64(this: &Blob, start: f64, end: f64) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_i32_and_i32_and_content_type(
this: &Blob,
start: i32,
end: i32,
content_type: &str,
) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_f64_and_i32_and_content_type(
this: &Blob,
start: f64,
end: i32,
content_type: &str,
) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_i32_and_f64_and_content_type(
this: &Blob,
start: i32,
end: f64,
content_type: &str,
) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( catch , method , structural , js_class = "Blob" , js_name = slice ) ]
#[doc = "The `slice()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn slice_with_f64_and_f64_and_content_type(
this: &Blob,
start: f64,
end: f64,
content_type: &str,
) -> Result<Blob, JsValue>;
# [ wasm_bindgen ( method , structural , js_class = "Blob" , js_name = text ) ]
#[doc = "The `text()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Blob/text)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`*"]
pub fn text(this: &Blob) -> ::js_sys::Promise;
}

View File

@ -0,0 +1,40 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = Event , extends = :: js_sys :: Object , js_name = BlobEvent , typescript_type = "BlobEvent" ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BlobEvent` class."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BlobEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEvent`*"]
pub type BlobEvent;
#[cfg(feature = "Blob")]
# [ wasm_bindgen ( structural , method , getter , js_class = "BlobEvent" , js_name = data ) ]
#[doc = "Getter for the `data` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BlobEvent/data)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobEvent`*"]
pub fn data(this: &BlobEvent) -> Option<Blob>;
#[wasm_bindgen(catch, constructor, js_class = "BlobEvent")]
#[doc = "The `new BlobEvent(..)` constructor, creating a new instance of `BlobEvent`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BlobEvent/BlobEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEvent`*"]
pub fn new(type_: &str) -> Result<BlobEvent, JsValue>;
#[cfg(feature = "BlobEventInit")]
#[wasm_bindgen(catch, constructor, js_class = "BlobEvent")]
#[doc = "The `new BlobEvent(..)` constructor, creating a new instance of `BlobEvent`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BlobEvent/BlobEvent)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEvent`, `BlobEventInit`*"]
pub fn new_with_event_init_dict(
type_: &str,
event_init_dict: &BlobEventInit,
) -> Result<BlobEvent, JsValue>;
}

View File

@ -0,0 +1,87 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BlobEventInit ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BlobEventInit` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"]
pub type BlobEventInit;
}
impl BlobEventInit {
#[doc = "Construct a new `BlobEventInit`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `bubbles` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"]
pub fn bubbles(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("bubbles"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `cancelable` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"]
pub fn cancelable(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("cancelable"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `composed` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobEventInit`*"]
pub fn composed(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composed"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "Blob")]
#[doc = "Change the `data` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Blob`, `BlobEventInit`*"]
pub fn data(&mut self, val: Option<&Blob>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,53 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BlobPropertyBag ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BlobPropertyBag` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"]
pub type BlobPropertyBag;
}
impl BlobPropertyBag {
#[doc = "Construct a new `BlobPropertyBag`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(feature = "EndingTypes")]
#[doc = "Change the `endings` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`, `EndingTypes`*"]
pub fn endings(&mut self, val: EndingTypes) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("endings"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `type` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*"]
pub fn type_(&mut self, val: &str) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,39 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BlockParsingOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BlockParsingOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"]
pub type BlockParsingOptions;
}
impl BlockParsingOptions {
#[doc = "Construct a new `BlockParsingOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `blockScriptCreated` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BlockParsingOptions`*"]
pub fn block_script_created(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("blockScriptCreated"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

View File

@ -0,0 +1,53 @@
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = BoxQuadOptions ) ]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `BoxQuadOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"]
pub type BoxQuadOptions;
}
impl BoxQuadOptions {
#[doc = "Construct a new `BoxQuadOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(feature = "CssBoxType")]
#[doc = "Change the `box` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`, `CssBoxType`*"]
pub fn box_(&mut self, val: CssBoxType) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("box"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `relativeTo` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `BoxQuadOptions`*"]
pub fn relative_to(&mut self, val: &::js_sys::Object) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("relativeTo"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}

Some files were not shown because too many files have changed in this diff Show More